Skip to content

Potential fix for code scanning alert no. 261: Workflow does not contain permissions - #56

Merged
joel-rieke merged 2 commits into
mainfrom
alert-autofix-261
Jan 28, 2026
Merged

Potential fix for code scanning alert no. 261: Workflow does not contain permissions#56
joel-rieke merged 2 commits into
mainfrom
alert-autofix-261

Conversation

@joel-rieke

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/trimble-oss/go-mysql-server/security/code-scanning/261

In general, the fix is to add an explicit permissions block to the workflow to scope the GITHUB_TOKEN to the least privileges required. Since this workflow reads and writes pull requests and issues (comments and closing PRs), it needs pull-requests: write and issues: write; it does not need broader contents: write, so we can keep repository contents access to read. Placing the permissions block at the top level (next to name and on) will apply it to all jobs, which is simplest and maintains consistent behavior. If any job later needs different permissions, a job-level override can be added, but nothing in the shown snippet requires broader access than PR/issue writes and read-only contents.

Concretely, edit .github/workflows/bump-dependency.yaml near the top of the file, after the name: Bump Deps line and before the on: block, to add:

permissions:
  contents: read
  pull-requests: write
  issues: write

No other changes are required: no imports or additional definitions are needed, and all jobs will now run with these explicit permissions instead of inheriting unspecified defaults.

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

joel-rieke and others added 2 commits January 28, 2026 10:30
…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@joel-rieke
joel-rieke marked this pull request as ready for review January 28, 2026 18:32
@joel-rieke
joel-rieke merged commit 7496402 into main Jan 28, 2026
9 of 12 checks passed
@joel-rieke
joel-rieke deleted the alert-autofix-261 branch January 28, 2026 18:33
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