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

docs: add content read permission throughout #226

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

blimmer
Copy link

@blimmer blimmer commented Aug 17, 2023

Linked issue

N/A

Additional context

If you don't provide contents: read permissions to workflows in private repos, you get an error during the checkout step:

Run actions/checkout@v3
Syncing repository: my-org/my-project
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/ed4d6daf-bb4f-470c-ba2f-679057aaa272' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/my-project/my-project
Deleting the contents of '/home/runner/work/my-project/my-project'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +9c37bea72cec39780111e301366f3974fa729e42:refs/remotes/pull/26/merge
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/my-org/my-project/' not found
  The process '/usr/bin/git' failed with exit code 128
  Waiting 17 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +9c37bea72cec39780111e301366f3974fa729e42:refs/remotes/pull/26/merge
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/my-org/my-project/' not found
  The process '/usr/bin/git' failed with exit code 128
  Waiting 15 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +9c37bea72cec39780111e301366f3974fa729e42:refs/remotes/pull/26/merge
  remote: Repository not found.
  Error: fatal: repository 'https://github.com/my-org/my-project/' not found
  Error: The process '/usr/bin/git' failed with exit code 128

For public repos, since the repo is open to the world, this permission isn't required (but it doesn't hurt to add the permission).

For the best developer experience, I think it makes sense to add this permission throughout the docs.

@brentvatne brentvatne requested a review from byCedric August 29, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant