TeachMePythonLikeIm5 icon indicating copy to clipboard operation
TeachMePythonLikeIm5 copied to clipboard

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

Open funbeedev opened this issue 4 years ago • 4 comments

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 avatar Oct 23 '21 14:10 funbeedev

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.

deepu14d avatar Oct 29 '21 12:10 deepu14d

@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 :)

funbeedev avatar Oct 31 '21 17:10 funbeedev

@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

deepu14d avatar Nov 05 '21 11:11 deepu14d

Open for hacktoberfest 2022!

funbeedev avatar Oct 04 '22 22:10 funbeedev