Skip to content

Set default permissions for workflows#185

Open
yedayak wants to merge 1 commit into
dgibson:mainfrom
yedayak:gha-permissions
Open

Set default permissions for workflows#185
yedayak wants to merge 1 commit into
dgibson:mainfrom
yedayak:gha-permissions

Conversation

@yedayak

@yedayak yedayak commented May 27, 2026

Copy link
Copy Markdown

Old github repositories created before 2023 run jobs with a GITHUB_TOKEN
that has write permissions by default for PRs from inside the repo (not
a fork), unless set otherwise in the repository.[0][1]

[0] https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
[1] https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/

Set it explicitly so there won't be a chance that a compromise of an action
will be able to modify anything in the repository.

Pointed out by zizmor[2]
[2] https://github.com/zizmorcore/zizmor

@dgibson dgibson force-pushed the main branch 2 times, most recently from 52f5915 to 8f48565 Compare May 28, 2026 02:43
@dgibson

dgibson commented May 28, 2026

Copy link
Copy Markdown
Owner

To consider this, I'll need a more detailed commit message. What is the effect of this change? Why is it valuable?

It will also need a Signed-off-by line as described in CONTRIBUTING.md.

Old github repositories created before 2023 run jobs with a GITHUB_TOKEN
that has write permissions by default for PRs from inside the repo (not
a fork), unless set otherwise in the repository.[0][1]

[0] https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
[1] https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/

Set it explicitly so there won't be a chance that a compromise of an action
will be able to modify anything in the repository.

Pointed out by zizmor[2]
[2] https://github.com/zizmorcore/zizmor

Signed-off-by: Yedaya Katsman <yedaya.ka@gmail.com>
@yedayak yedayak force-pushed the gha-permissions branch from 8273239 to cb7d65d Compare May 28, 2026 11:31
@yedayak yedayak changed the title Set default permissions for job Set default permissions for workflows May 28, 2026
@yedayak

yedayak commented May 28, 2026

Copy link
Copy Markdown
Author

To consider this, I'll need a more detailed commit message. What is the effect of this change? Why is it valuable?

It will also need a Signed-off-by line as described in CONTRIBUTING.md.

Updated with more detail, and added SoB

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.

2 participants