forked from mouredev/roadmap-retos-programacion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/hozlucas28-automated-pull-request-ch…
…ecks
- Loading branch information
Showing
897 changed files
with
114,423 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.github/actions/pull-requests/check-committed-file/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# ---------------------------------------------------------------------------- # | ||
# NODE # | ||
# ---------------------------------------------------------------------------- # | ||
|
||
# ------------------------------- Dependencies ------------------------------- # | ||
|
||
node_modules/ |
23 changes: 23 additions & 0 deletions
23
.github/actions/pull-requests/check-committed-file/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
author: 'hozlucas28' | ||
|
||
name: 'Check committed file' | ||
description: 'Check if the committed file of a pull request is valid' | ||
|
||
runs: | ||
using: 'node20' | ||
main: 'main.js' | ||
|
||
inputs: | ||
author: | ||
description: 'Name of the user who created the pull request' | ||
required: true | ||
committed-file: | ||
description: 'Committed file of the pull request' | ||
required: true | ||
title: | ||
description: 'Title of the pull request' | ||
required: true | ||
log01: | ||
required: true | ||
log02: | ||
required: true |
3 changes: 3 additions & 0 deletions
3
.github/actions/pull-requests/check-committed-file/dist/index.js
Large diffs are not rendered by default.
Oops, something went wrong.
120 changes: 120 additions & 0 deletions
120
.github/actions/pull-requests/check-committed-file/dist/licenses.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
@actions/core | ||
MIT | ||
The MIT License (MIT) | ||
|
||
Copyright 2019 GitHub | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
@actions/http-client | ||
MIT | ||
Actions Http Client for Node.js | ||
|
||
Copyright (c) GitHub, Inc. | ||
|
||
All rights reserved. | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | ||
associated documentation files (the "Software"), to deal in the Software without restriction, | ||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT | ||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | ||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
|
||
@fastify/busboy | ||
MIT | ||
Copyright Brian White. All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to | ||
deal in the Software without restriction, including without limitation the | ||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
sell copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
IN THE SOFTWARE. | ||
|
||
tunnel | ||
MIT | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2012 Koichi Kobayashi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
||
|
||
undici | ||
MIT | ||
MIT License | ||
|
||
Copyright (c) Matteo Collina and Undici contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
|
||
uuid | ||
MIT | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2010-2020 Robert Kieffer and other contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
3 changes: 3 additions & 0 deletions
3
.github/actions/pull-requests/check-committed-file/dist/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
67 changes: 67 additions & 0 deletions
67
.github/actions/pull-requests/check-committed-file/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { debug, getInput, setFailed } from '@actions/core' | ||
import * as path from 'node:path' | ||
import { getChallengeFolder, getProgrammingLanguageExtension, wrapperChallengesFolder } from '../../utils.mjs' | ||
|
||
// Inputs | ||
const author = getInput('author') | ||
const committedFile = getInput('committed-file') | ||
const title = getInput('title') | ||
debug(`'author' (input): ${author}`) | ||
debug(`'committed-file' (input): ${committedFile}`) | ||
debug(`'title' (input): ${title}`) | ||
|
||
// Required data | ||
const titleProps = { | ||
challenge: title.slice(1, 3), | ||
language: title.slice(6).toLowerCase(), | ||
} | ||
debug(`Title properties: ${JSON.stringify(titleProps)}`) | ||
|
||
const challengeFolder = getChallengeFolder(titleProps.challenge) | ||
const committedFileProps = path.parse(committedFile) | ||
committedFileProps.dir = path.normalize(committedFileProps.dir) | ||
debug(`Folder name of the programming language: ${challengeFolder}`) | ||
debug(`Committed file properties: ${JSON.stringify(committedFileProps)}`) | ||
|
||
// Check if directory is valid | ||
const expectedDirectory = path.join(wrapperChallengesFolder, challengeFolder, titleProps.language) | ||
const isValidDirectory = committedFileProps.dir === expectedDirectory | ||
debug(`Expected directory: ${expectedDirectory}`) | ||
debug(`Is valid directory? ${isValidDirectory}`) | ||
|
||
if (!isValidDirectory) { | ||
setFailed( | ||
"Directory of committed file doesn't match with the challenge and programming language of the pull request title. " + | ||
'Please check the directory of committed file of the pull request. ' + | ||
`It should be: '${expectedDirectory}'. ` + | ||
'If you think this is an error, please contact an administrator.' | ||
) | ||
} | ||
|
||
// Check if file name is valid | ||
const isValidFileName = committedFileProps.name === author | ||
debug(`Is valid file name? ${isValidFileName}`) | ||
|
||
if (!isValidFileName) { | ||
setFailed( | ||
"File name of committed file doesn't match with the author name. " + | ||
'Please check the file name of committed file of the pull request. ' + | ||
`It should be: '${author}'. ` + | ||
'If you think this is an error, please contact an administrator.' | ||
) | ||
} | ||
|
||
// Check if file extension is valid | ||
const expectedFileExtension = getProgrammingLanguageExtension(titleProps.language) | ||
const isValidFileExtension = committedFileProps.ext === expectedFileExtension | ||
debug(`Expected file extension: ${expectedFileExtension}`) | ||
debug(`Is valid file extension? ${isValidFileExtension}`) | ||
|
||
if (!isValidFileExtension) { | ||
setFailed( | ||
"File extension of committed file doesn't match with the programming language name of the pull request title. " + | ||
'Please check the file extension name of committed file of the pull request. ' + | ||
`It should be: '${expectedFileExtension}'. ` + | ||
'If you think this is an error, please contact an administrator.' | ||
) | ||
} |
16 changes: 16 additions & 0 deletions
16
.github/actions/pull-requests/check-committed-file/node_modules/.bin/uuid
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
.github/actions/pull-requests/check-committed-file/node_modules/.bin/uuid.cmd
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
.github/actions/pull-requests/check-committed-file/node_modules/.bin/uuid.ps1
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
.github/actions/pull-requests/check-committed-file/node_modules/.package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
...ctions/pull-requests/check-committed-file/node_modules/@actions/core/LICENSE.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.