Skip to content

Move checks: write permission to job level - #134

Merged
hanlaur merged 1 commit into
mainfrom
copilot/fix-job-level-permissions
Apr 11, 2026
Merged

hanlaur merged 1 commit into
mainfrom
copilot/fix-job-level-permissions

Conversation

Copilot AI commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

GitHub Actions best practice (SonarCloud rule githubactions:S8233) requires write permissions to be scoped to the job level rather than the workflow level, minimizing the blast radius of any compromised job.

Changes

  • Workflow level (permissions): removed checks: write, retaining only contents: read and pull-requests: read
  • lint job (permissions): added checks: write — the only job that needs it (golangci-lint-action posts check annotations)
# Before
permissions:
  contents: read
  pull-requests: read
  checks: write        # ← write at workflow scope

# After
permissions:
  contents: read
  pull-requests: read

jobs:
  lint:
    permissions:
      checks: write    # ← scoped to the job that needs it

@sonarqubecloud

Copy link
Copy Markdown

@hanlaur hanlaur added the chore Maintenance tasks label Apr 11, 2026
@hanlaur
hanlaur marked this pull request as ready for review April 11, 2026 17:55
@hanlaur
hanlaur merged commit f854336 into main Apr 11, 2026
9 of 10 checks passed
@hanlaur
hanlaur deleted the copilot/fix-job-level-permissions branch April 11, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址