Skip to content

build: limit workflow gh token permissions - #48237

Merged
MarshallOfSound merged 2 commits into
mainfrom
sam/limit-workflow-permissions
Nov 14, 2025
Merged

MarshallOfSound merged 2 commits into
mainfrom
sam/limit-workflow-permissions

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

No real issue here, this is just good practice limiting the scope of these tokens. In general we should be doing permissions: {} at the root of the workflow and then each job specifies it's permission requirements individually.

Notes: none

@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner September 1, 2025 21:00
@MarshallOfSound MarshallOfSound added target/35-x-y PR should also be added to the "35-x-y" branch. target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Sep 1, 2025
@MarshallOfSound
MarshallOfSound force-pushed the sam/limit-workflow-permissions branch from eda799e to 808cd65 Compare September 2, 2025 15:25
@github-actions github-actions Bot added the target/39-x-y PR should also be added to the "39-x-y" branch. label Sep 3, 2025
Comment on lines -10 to -11
permissions:
contents: read

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to push this down into the job permissions, or do we think it's unnecessary for this action?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining per-job is IMO good practice, it prevents leaky default permissions. i.e. the top-level permissions should always be {} and each job should ask for more specifically

Comment thread .github/workflows/issue-transferred.yml Resolved
Comment thread .github/workflows/issue-opened.yml Resolved
Comment thread .github/workflows/issue-opened.yml Resolved
@jkleinsc jkleinsc removed the target/35-x-y PR should also be added to the "35-x-y" branch. label Oct 20, 2025
@github-actions github-actions Bot added the target/40-x-y PR should also be added to the "40-x-y" branch. label Oct 28, 2025

@dsanders11 dsanders11 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking comments still stand, but I'm clearing the request changes.

@MarshallOfSound
MarshallOfSound force-pushed the sam/limit-workflow-permissions branch from 808cd65 to 7d6c4d2 Compare November 14, 2025 08:24
@MarshallOfSound
MarshallOfSound merged commit 925966f into main Nov 14, 2025
@MarshallOfSound
MarshallOfSound deleted the sam/limit-workflow-permissions branch November 14, 2025 20:11
@release-clerk

release-clerk Bot commented Nov 14, 2025

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "40-x-y", please check out #48966

@trop

trop Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "36-x-y", please check out #48967

@trop

trop Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "38-x-y", please check out #48968

@trop trop Bot added in-flight/36-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels Nov 14, 2025
@trop

trop Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "39-x-y", please check out #48969

@trop

trop Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "37-x-y", please check out #48970

@trop trop Bot added in-flight/38-x-y in-flight/39-x-y in-flight/37-x-y merged/39-x-y PR was merged to the "39-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. and removed target/36-x-y PR should also be added to the "36-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. in-flight/36-x-y in-flight/39-x-y in-flight/38-x-y in-flight/37-x-y in-flight/40-x-y labels Nov 14, 2025
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. semver/none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants