Skip to content

Commit 96ce380

Browse files
committed
ci: reduce workflow-level permissions to least privilege
semantic-release uses the GitHub App token for all write operations, so the workflow's default GITHUB_TOKEN only needs id-token (OIDC provenance), packages (GitHub Packages publish), and contents read (for the CI validation workflow to checkout the repository).
1 parent 15ecb4c commit 96ce380

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/publish-package-release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@ permissions:
1313
id-token: write
1414
# Enable the use of GitHub Packages registry
1515
packages: write
16-
# Enable `semantic-release` to publish a GitHub release and push commits
17-
contents: write
18-
# Enable `semantic-release` to post comments on issues
19-
issues: write
20-
# Enable `semantic-release` to post comments on pull requests
21-
pull-requests: write
16+
# Enable the CI validation workflow to checkout the repository
17+
contents: read
2218

2319
# The release workflow involves many crucial steps that once triggered shouldn't be cancelled until
2420
# finished, otherwise we might end up in an inconsistent state (e.g., published to GitHub Packages

0 commit comments

Comments
 (0)