Skip to content

Feature/hozlucas28 automated checks #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dd9b6d2
Create check-pull-request-title action
hozlucas28 Jan 22, 2024
8c220f9
Create check-pull-request-changed-files action
hozlucas28 Jan 22, 2024
f68dd32
Add utils.js file with language and challenge functions
hozlucas28 Jan 22, 2024
e30e9fe
Add language data to data.json
hozlucas28 Jan 22, 2024
b75bccd
Add GitHub Actions workflow to check pull requests
hozlucas28 Jan 22, 2024
e3abfd0
Add pull request title and changed file checks
hozlucas28 Jan 22, 2024
53e8d6c
Update language names in data.json
hozlucas28 Jan 22, 2024
ec67198
Update pull request title validation
hozlucas28 Jan 22, 2024
ce7e5e8
Refactor utils.js to use object literals for challenges and programmi…
hozlucas28 Jan 22, 2024
a6cea98
Update comments
hozlucas28 Jan 22, 2024
f656d03
Rename input name in check-pull-request.yml workflow
hozlucas28 Jan 22, 2024
9c2db6f
Update strings of check-pull-request-title action
hozlucas28 Jan 22, 2024
64015a8
Update action.yml and main.js for checking changed and modified files…
hozlucas28 Jan 22, 2024
66c4c88
Move and rename action folders
hozlucas28 Jan 22, 2024
2acba31
Update file extension name in data.json
hozlucas28 Jan 22, 2024
d70552a
Add outputs for challenge number and programming language name based …
hozlucas28 Jan 22, 2024
dfaee92
Add new outputs
hozlucas28 Jan 22, 2024
5ceced5
Add Roadmap folder to pull request check
hozlucas28 Jan 22, 2024
7167b85
Refactor pull request title validation logic
hozlucas28 Jan 22, 2024
663950b
Add debug statement to check changed and modified files
hozlucas28 Jan 22, 2024
ef00b88
Create action to check changed or modified file
hozlucas28 Jan 22, 2024
f7881df
Refactor utils.js to add new functions and improve existing ones
hozlucas28 Jan 22, 2024
0ed0673
Update language data in data.json
hozlucas28 Jan 22, 2024
bf6aa18
Update workflow inputs and outputs
hozlucas28 Jan 22, 2024
a1d92f9
Update inputs and outputs
hozlucas28 Jan 22, 2024
f5bb702
Update output variable name
hozlucas28 Jan 22, 2024
0c03453
Update output variable names
hozlucas28 Jan 22, 2024
3f8e014
Update programming-language description in action.yml
hozlucas28 Jan 22, 2024
f2c5a22
Refactor check-changed-or-modified-file script
hozlucas28 Jan 22, 2024
01da703
Refactor utils.js to improve readability and add new functionality
hozlucas28 Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .github/actions/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"languages": [
{
"fileExtension": "js",
"name": "JavaScript"
},
{
"fileExtension": "py",
"name": "Python"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
author: 'hozlucas28'
name: 'Check changed and modified files of a pull request'
description: 'Check if changed and modified files of a pull request are valid'

runs:
using: 'node20'
main: 'main.js'

inputs:
changed-or-modified-files:
description: 'Changed and modified files of the pull request'
required: true

outputs:
changed-or-modified-file:
description: 'Unique changed or modified file of the pull request'
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const core = require('@actions/core')

// Required data
const changedAndModifiedFiles = core.getInput('changed-and-modified-files').split(' ')
core.debug(`Changed and modified files: ${changedAndModifiedFiles}`)

// Check if changed and modified files are valid
const isValidFiles = changedAndModifiedFiles.length === 1

if (isValidFiles) {
// On valid files, set the output
core.setOutput('changed-or-modified-file', changedAndModifiedFiles[0])
} else {
// On invalid files, set the action as failed
core.setFailed(
'Pull request must change or modified exactly one file. ' +
'Please, check the pull request and try again. ' +
'If you think this is an error, please contact an administrator.'
)
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading