inspirezonetech / TeachMePythonLikeIm5

Teach the Python programming language using a collection of super beginner friendly tutorials and challenges.
https://inspirezone.tech/
MIT License
25 stars 43 forks source link

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

Open funbeedev opened 2 years ago

funbeedev commented 2 years ago

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.

deepu14d commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

@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 commented 1 year ago

Open for hacktoberfest 2022!