Skip to content

Restrict default GitHub Actions token permissions in release workflow#13

Closed
pycabbage with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alerts
Closed

Restrict default GitHub Actions token permissions in release workflow#13
pycabbage with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alerts

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown

The release workflow was inheriting default GITHUB_TOKEN permissions for the build job, which triggered the code scanning alert for missing explicit workflow permissions. This change narrows the workflow default while preserving the release job’s required write access.

  • Workflow permissions

    • Added an explicit top-level permissions block to .github/workflows/release.yml
    • Set the default token scope to contents: read for jobs that do not need elevated access
  • Release behavior

    • Kept the release job’s existing permissions: contents: write unchanged
    • Leaves tag-based release creation behavior intact while reducing privilege for the rest of the workflow
permissions:
  contents: read

jobs:
  build:
    ...

  release:
    permissions:
      contents: write

Copilot AI requested review from Copilot and removed request for Copilot July 22, 2026 06:17
Copilot AI requested review from Copilot and removed request for Copilot July 22, 2026 06:18
Copilot AI changed the title [WIP] Fix code scanning alert #2 Restrict default GitHub Actions token permissions in release workflow Jul 22, 2026
Copilot AI requested a review from pycabbage July 22, 2026 06:19
@pycabbage pycabbage closed this Jul 22, 2026
@pycabbage
pycabbage deleted the copilot/fix-code-scanning-alerts branch July 22, 2026 07:11
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