Skip to content

Add explicit permissions to GitHub Actions workflows - #2138

Open
Seanstoppable wants to merge 1 commit into
wtfutil:trunkfrom
Seanstoppable:seanstoppable-fix-workflow-permissions
Open

Add explicit permissions to GitHub Actions workflows#2138
Seanstoppable wants to merge 1 commit into
wtfutil:trunkfrom
Seanstoppable:seanstoppable-fix-workflow-permissions

Conversation

@Seanstoppable

Copy link
Copy Markdown
Collaborator

Summary

Adds least-privilege permissions declarations to all workflow files to resolve CodeQL code scanning alerts #52#59.

Changes

Workflow Permissions Rationale
staticcheck.yml contents: read, pull-requests: write Checks out code; action posts PR comments via GITHUB_TOKEN
golangci-lint.yml contents: read Only checks out and lints code
codeql-analysis.yml contents: read, security-events: write Checks out code; uploads SARIF results
goreleaser.yml contents: write Uploads release assets (uses PAT but safe fallback)
pr-checks.yml contents: read Only checks out code and runs snapshot build

Testing

  • The PR-triggered workflows (staticcheck, golangci-lint, codeql-analysis, pr-checks) will run on this PR — if permissions are too restrictive, jobs will fail with 403 errors.
  • goreleaser.yml only triggers on tags and can be validated separately.

Add least-privilege permissions declarations to all workflow files
to resolve CodeQL code scanning alerts #52-#59.

- staticcheck.yml: contents:read, pull-requests:write
- golangci-lint.yml: contents:read
- codeql-analysis.yml: contents:read, security-events:write
- goreleaser.yml: contents:write
- pr-checks.yml: contents:read

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

1 participant