Skip to content

docs: write permission to Actions example to avoid 403 on push#4833

Open
nanami-takemoto wants to merge 1 commit intoanuraghazra:masterfrom
nanami-takemoto:docs/readme-actions-permissions
Open

docs: write permission to Actions example to avoid 403 on push#4833
nanami-takemoto wants to merge 1 commit intoanuraghazra:masterfrom
nanami-takemoto:docs/readme-actions-permissions

Conversation

@nanami-takemoto
Copy link
Copy Markdown

@nanami-takemoto nanami-takemoto commented Mar 7, 2026

Summary

When setting up the GitHub Actions workflow from the README, the job may fail when trying to push the generated SVG files back to the repository.

Example error:

Permission to <repo> denied to github-actions[bot]

This happens when the repository uses read-only default workflow permissions, which is now the default setting for many repositories.
In that configuration, the GITHUB_TOKEN does not have permission to push commits.

Changes

The GitHub Actions example in the README now explicitly includes:

permissions:
  contents: write

This allows the workflow to push the generated files back to the repository.

Explicitly specifying this permission makes the example work out-of-the-box even for repositories using read-only default workflow permissions.
It also makes the required permission clearer for users who are new to GitHub Actions.

The same permission is also documented in the GitHub Actions version of this project:
https://github.com/stats-organization/github-readme-stats-action#readme

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 7, 2026

@nanami-takemoto is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the documentation Improvements or additions to documentation. label Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant