Skip to content

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

Closed
1 task done
avinal opened this issue Aug 30, 2021 · 7 comments · Fixed by #20132
Closed
1 task done

Add correct commands for steps on Creating a Docker container action page #9432

avinal opened this issue Aug 30, 2021 · 7 comments · Fixed by #20132
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team good first issue Good for newcomers help wanted Anyone is welcome to open a pull request to fix this issue

Comments

@avinal
Copy link
Contributor

avinal commented Aug 30, 2021

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.

 git update-index --chmod=+x entrypoint.sh

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.

@avinal avinal added the content This issue or pull request belongs to the Docs Content team label Aug 30, 2021
@welcome
Copy link

welcome bot commented Aug 30, 2021

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.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Aug 30, 2021
@ramyaparimi
Copy link
Contributor

@avinal
Thanks so much for opening an issue! I'll triage this for the team to take a look 👀

@ramyaparimi ramyaparimi added actions This issue or pull request should be reviewed by the docs actions team and removed triage Do not begin working on this issue until triaged by the team labels Aug 31, 2021
@Kellyjo152

This comment has been minimized.

@skedwards88
Copy link
Contributor

Thank you for this detailed issue! You or anyone else is welcome to open a PR to address this.

@skedwards88 skedwards88 added the help wanted Anyone is welcome to open a pull request to fix this issue label Sep 23, 2021
@avinal
Copy link
Contributor Author

avinal commented Sep 23, 2021

Thanks @skedwards88, I would like to open a PR.

@github-actions github-actions bot added the stale There is no recent activity on this issue or pull request label Nov 23, 2021
@ramyaparimi ramyaparimi removed the stale There is no recent activity on this issue or pull request label Dec 1, 2021
@ramyaparimi ramyaparimi reopened this Dec 1, 2021
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Dec 1, 2021
@ramyaparimi ramyaparimi removed the triage Do not begin working on this issue until triaged by the team label Dec 1, 2021
@ramyaparimi ramyaparimi added the good first issue Good for newcomers label Jan 26, 2022
@noviicee
Copy link
Contributor

Hi! Since there has been no recent updates, can I take it from here..?

@cmwilson21
Copy link
Contributor

@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! 💖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team good first issue Good for newcomers help wanted Anyone is welcome to open a pull request to fix this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@skedwards88 @ramyaparimi @noviicee @avinal @cmwilson21 @Kellyjo152 and others