Skip to content
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

GitHub action execute-modified-python-file.yml will not run when a new file is created and added to repo #99

Open
funbeedev opened this issue Oct 23, 2021 · 4 comments
Labels
bug Something isn't working github-actions Related to GitHub Actions hacktoberfest help wanted Extra attention is needed

Comments

@funbeedev
Copy link
Member

funbeedev commented Oct 23, 2021

About Bug or problem
The GitHub action to execute python file will not run when a file is created rather than modified.
This is because the action is designed only to check files that were modified and so will ignore files that are new to the repo.

Steps to reproduce
Create a brand new python file and add to the repo. The GitHub action will not see any files as being modified and will print:

Run echo "job: running script to execute modified file:"
job: running script to execute modified file:
run-sh: Inside run-modified-python.sh
run-sh: Content of files_modified.json: []
run-sh: After parsing, file to execute: 
run-sh: File modified is not a python file! Will not execute
job: Done

Potential fix
Modify action execute-modified-python-file.yml to detect when new files are added to the repo and execute them.

@funbeedev funbeedev added bug Something isn't working help wanted Extra attention is needed hacktoberfest labels Oct 23, 2021
@funbeedev funbeedev changed the title execute-modified-python-file.yml will not run when a new file is created and added to repo GitHub action execute-modified-python-file.yml will not run when a new file is created and added to repo Oct 23, 2021
@deepu14d
Copy link
Contributor

deepu14d commented Oct 29, 2021

Hi
Is it possible that this error is because the file is not getting permission for execution ?
Maybe there is some problem in sh file not in yaml as it's working till the line " job: running script to execute modified file:" but after that, the script .sh code isn't working for new files I think.
( I am saying this based on that tuple commit, the error there is saying like permission denied (exit code 126) and that line of yaml can also be seen.)
error.png

PS: - Sorry, if it's wrong. I don't know much about yaml and sh, I tried to just work something out.

@funbeedev
Copy link
Member Author

@deepu14d Thanks for the analysis! But I think its because the Github workflow to detect modified files only works if the file already existed and was modified. If the file is newly created it doesn't detect it as being modified. If you have any further thoughts let me know :)

@deepu14d
Copy link
Contributor

deepu14d commented Nov 5, 2021

@deepu14d Thanks for the analysis! But I think its because the Github workflow to detect modified files only works if the file already existed and was modified. If the file is newly created it doesn't detect it as being modified. If you have any further thoughts let me know :)

um yeah you are right

@funbeedev
Copy link
Member Author

Open for hacktoberfest 2022!

@funbeedev funbeedev added the github-actions Related to GitHub Actions label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working github-actions Related to GitHub Actions hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants