Skip to content

security(release): declare least-privilege permissions on the release workflow#1396

Merged
pranav-new-relic merged 1 commit into
mainfrom
chore/release-workflow-permissions
Jul 13, 2026
Merged

security(release): declare least-privilege permissions on the release workflow#1396
pranav-new-relic merged 1 commit into
mainfrom
chore/release-workflow-permissions

Conversation

@pranav-new-relic

Copy link
Copy Markdown
Member

Summary

Fixes CodeQL alerts #61 and #43 — both are actions/missing-workflow-permissions (medium severity) against .github/workflows/release.yml.

Adopts the workflow-level default already used by cleanup-jp.yml and nonregression-jp.yml:

permissions:
  contents: read

…and overrides individually where a job legitimately needs more:

Job Perm Why
build contents: write actions/create-release@v1 publishes the Release
zip-recipes contents: write actions/upload-release-asset attaches recipes.zip
commit-release-notes (inherits contents: read) Push uses secrets.RELEASE_TOKEN (PAT), not GITHUB_TOKEN — this also tightens a leftover contents: write from before #1395 landed

Test plan

… workflow

Fixes CodeQL alerts #61 and #43 (actions/missing-workflow-permissions,
medium severity) on .github/workflows/release.yml.

Adopts the workflow-level default already used by cleanup-jp.yml and
nonregression-jp.yml — `permissions: contents: read` at the top — and
overrides individually where a job legitimately needs more:

- build: contents: write (actions/create-release@v1 publishes the Release)
- zip-recipes: contents: write (actions/upload-release-asset attaches recipes.zip)
- commit-release-notes: no override; falls back to workflow-level
  contents: read. Its push already uses secrets.RELEASE_TOKEN (a PAT),
  not the default GITHUB_TOKEN, so GITHUB_TOKEN doesn't need write on
  this job. This tightens up the earlier grant that was left over from
  when the job used GITHUB_TOKEN for the push (before #1395).

No behavior change — the workflow's actual runtime permissions are
unchanged for the two jobs that need write, and correctly downgraded
for the one that doesn't.
@pranav-new-relic pranav-new-relic merged commit 725c3ac into main Jul 13, 2026
20 checks passed
@pranav-new-relic pranav-new-relic deleted the chore/release-workflow-permissions branch July 13, 2026 17:26
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