-
Notifications
You must be signed in to change notification settings - Fork 61.8k
Add correct commands for steps on Creating a Docker container action page #9432
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
Comments
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines. |
@avinal |
This comment has been minimized.
This comment has been minimized.
Thank you for this detailed issue! You or anyone else is welcome to open a PR to address this. |
Thanks @skedwards88, I would like to open a PR. |
Hi! Since there has been no recent updates, can I take it from here..? |
@noviicee Thanks for checking in! You or anyone else are welcome to work on this issue. Thanks for your interest and passion for improving GitHub docs! 💖 |
Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action
What part(s) of the article would you like to see updated?
The Parts that need modification
Context
Seven months ago I worked on an issue #974 and submitted PR #1256 and #2988. There was performance concern over making shell files executable explicitly inside the Docker. This
#1256 (comment) has all the discussion.
Ultimately it was decided to suggest the users to run
chmod +x entrypoint.sh
on their machine before pushing it to the remote. I was not convinced that this will work and there won't be any permission issue while running the script inside GitHub Actions and I am still not convinced.Root of the problem.
For the most part, the above method works fine. The problem occurs only when someone clones the repo and then make changes. The permission is reset and it no longer can be run inside GitHub Actions. And that is why you will see a lot of developers/organizations have explicitly made the shell executable inside GitHub Actions before running it.
What do I suggest
Git provides a way to explicitly change the permission mode of a file so that it doesn't get reset every time there is a clone/fork. The command works as below.
This will change the permission mode of the file in the git index and it can be checked by running following command.
git ls-files --stage entrypoint.sh # output 100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 entrypoint.sh
Here
755
denotes the executable permission.Additional information
These lines here https://github.com/github/docs/blame/main/content/actions/creating-actions/creating-a-docker-container-action.md#L124-L128 have no use and can be removed if we opt for the above solution.
The text was updated successfully, but these errors were encountered: