Skip to content

Conversation

@DennisDyallo
Copy link
Collaborator

Move write permissions from top-level to job-level scope to follow security best practices. This ensures each job only has the minimum permissions needed to perform its specific tasks.

Changes:

  • build-pull-requests.yml: Move checks/pull-requests write to run-tests job
  • test.yml: Move checks/pull-requests write to specific PR comment jobs
  • codeql-analysis.yml: Move security-events write to analyze job
  • build.yml: Add explanatory comments for existing job-level permissions
  • claude.yml: Add explanatory comments for required write permissions

Move write permissions from top-level to job-level scope to follow
security best practices. This ensures each job only has the minimum
permissions needed to perform its specific tasks.

Changes:
- build-pull-requests.yml: Move checks/pull-requests write to run-tests job
- test.yml: Move checks/pull-requests write to specific PR comment jobs
- codeql-analysis.yml: Move security-events write to analyze job
- build.yml: Add explanatory comments for existing job-level permissions
- claude.yml: Add explanatory comments for required write permissions
@DennisDyallo DennisDyallo requested a review from Copilot January 7, 2026 11:13
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 refactors GitHub Actions workflow permissions to follow the principle of least privilege by moving write permissions from workflow-level scope to job-level scope. This security improvement ensures that each job only receives the minimum permissions required to perform its specific tasks, reducing the attack surface if a workflow is compromised.

Key Changes:

  • Moved write permissions (checks, pull-requests, security-events, packages, attestations) from top-level to job-level scope
  • Added explanatory comments documenting why each permission is required
  • Reorganized permission declarations for better readability with inline comments

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/test.yml Moved pull-requests and checks write permissions to specific PR comment jobs that need them
.github/workflows/codeql-analysis.yml Moved security-events write permission to the analyze job that uploads scan results
.github/workflows/claude.yml Added explanatory comments for existing job-level permissions
.github/workflows/build.yml Added explanatory comments for existing job-level permissions and reorganized declarations
.github/workflows/build-pull-requests.yml Moved pull-requests and checks write permissions to run-tests job

Uncomment repo_token configuration to enable the Branch-Protection check.
This requires a fine-grained PAT with "Administration: Read-only" permission
to be added as a repository secret named SCORECARD_TOKEN.
@DennisDyallo DennisDyallo merged commit 958dc3f into develop Jan 7, 2026
4 checks passed
@DennisDyallo DennisDyallo deleted the feature/least-privilege-workflow-permissions branch January 7, 2026 12:03
@equijano21
Copy link
Contributor

@DennisDyallo since these changes only affect our GitHub repo's workflows, I'm assuming they do not need to be mentioned in a release note. If that's incorrect, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants