Skip to content

Conversation

@arnested
Copy link
Owner

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

The best way to address the problem is to explicitly restrict the GITHUB_TOKEN permissions at the workflow level by adding a permissions: block to the root of the workflow. This ensures that all jobs default to these permissions unless overridden locally.
For pure linting jobs such as these, the only required permission is contents: read. No job is expected to modify repository contents, publish artifacts, comment on issues or PRs, etc.
Therefore, add the following block after the name: Lint and before on: pull_request (or immediately after on: if conventionally preferred):

permissions:
  contents: read

Only the file .github/workflows/lint.yml needs to be edited.


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:29
@arnested arnested merged commit ce748c8 into main Aug 23, 2025
12 checks passed
@arnested arnested deleted the alert-autofix-5 branch August 23, 2025 20:29
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