Skip to content

fix: move workflow permissions from job level to workflow level#433

Closed
jmeridth wants to merge 1 commit intomainfrom
fix/workflow-permissions-to-workflow-level
Closed

fix: move workflow permissions from job level to workflow level#433
jmeridth wants to merge 1 commit intomainfrom
fix/workflow-permissions-to-workflow-level

Conversation

@jmeridth
Copy link
Collaborator

@jmeridth jmeridth commented Mar 16, 2026

What

Moves permissions declarations from job level back to workflow level across all workflow files.

Why

Workflow-level permissions sets the maximum token permissions for all jobs. With contents: read at workflow level, job-level contents: write was silently capped, causing Resource not accessible by integration errors (e.g., markPullRequestReadyForReview in mark-ready-when-ready).

Notes

  • Multi-job workflows (e.g., release.yml) now declare the union of all job permissions at workflow level, which is slightly broader per-job but avoids the cap issue
  • Reviewers should verify that no workflow previously had intentionally restricted job-level permissions that differ from other jobs in the same workflow

@jmeridth jmeridth requested a review from zkoppert as a code owner March 16, 2026 16:22
Copilot AI review requested due to automatic review settings March 16, 2026 16:22
@github-actions github-actions bot added the fix label Mar 16, 2026
Job-level permissions are capped by workflow-level permissions. With
workflow-level set to only `contents: read`, job-level write permissions
were silently capped, breaking actions like markPullRequestReadyForReview.
@jmeridth jmeridth force-pushed the fix/workflow-permissions-to-workflow-level branch from 8138eef to 83bef7a Compare March 16, 2026 16:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts GitHub Actions workflow token permissions by moving permissions: from individual jobs to the workflow level to prevent job-level write permissions from being silently capped by more restrictive workflow-level defaults (which can cause Resource not accessible by integration failures).

Changes:

  • Move job-scoped permissions declarations to workflow-level permissions across multiple workflows.
  • Broaden workflow-level permissions in multi-job workflows to the union required by all jobs to avoid permission caps.
  • Align workflows that call reusable workflows to rely on workflow-level permissions rather than per-job blocks.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/stale.yml Moves issue/PR permissions from job to workflow scope for stale issue automation.
.github/workflows/scorecard.yml Elevates required Scorecard permissions to workflow scope (id-token, security-events).
.github/workflows/release.yml Moves all release-related permissions to workflow scope and removes per-job restrictions.
.github/workflows/pr-title.yml Moves reusable PR title workflow permissions to workflow scope.
.github/workflows/mark-ready-when-ready.yml Fixes permission capping by declaring required write permissions at workflow level.
.github/workflows/codeql.yml Moves CodeQL scan permissions to workflow scope.
.github/workflows/auto-labeler.yml Moves PR labeling permissions to workflow scope for pull_request_target runs.

Comment on lines 8 to +14
permissions:
contents: read
attestations: write
contents: write
discussions: write
id-token: write
packages: write
pull-requests: read
@jmeridth jmeridth marked this pull request as draft March 16, 2026 18:33
@jmeridth jmeridth closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants