Skip to content

Conversation

@arnested
Copy link
Owner

Potential fix for https://github.com/arnested/go-version-action/security/code-scanning/1

To fix this issue, you should add a permissions block to the workflow to scope token access. This can be done either at the workflow root (affecting all jobs) or at the job level (affecting just one job). As all jobs are within one block (release), adding at the job level is fine and more flexible. Given the operations—pushing commits/tags and creating releases—the job needs contents: write for code pushes, and also packages: write if any package-related permissions are needed. For creating releases, contents: write is usually sufficient. Unless other scopes are strictly needed, you should explicitly set only the required scopes. The minimal and safe recommendation is:

permissions:
  contents: write

Add this block to the release job (line 12), just before or after runs-on: ubuntu-latest. This change will restrict the token issued to this job to only have write access to repository contents (commits, tags, and releases). No other permissions (such as admin or broader write) will be granted.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@arnested arnested marked this pull request as ready for review August 23, 2025 20:30
@arnested arnested merged commit 5ded107 into main Aug 23, 2025
13 checks passed
@arnested arnested deleted the alert-autofix-1 branch August 23, 2025 20:30
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