Skip to content

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

Merged
joel-rieke merged 1 commit into
mainfrom
alert-autofix-262
Jan 28, 2026
Merged

Potential fix for code scanning alert no. 262: Workflow does not contain permissions#55
joel-rieke merged 1 commit into
mainfrom
alert-autofix-262

Conversation

@joel-rieke

Copy link
Copy Markdown
Collaborator

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

To fix the problem, we should add an explicit permissions block to the workflow. The best practice is to set the minimal permissions required for the workflow to function. Since the workflow has three jobs:

  • format: uses EndBug/add-and-commit@v9.1.1 to commit changes, so it needs contents: write.
  • verify and alt-verify: only need to read repository contents.

We can set a default permissions block at the workflow level with contents: read, and override it for the format job with contents: write. This ensures that only the job that needs write access gets it, and all others are restricted to read-only.

The changes should be made at the top of the workflow file (after the name: and before on:), and within the format job definition.

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

…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:26
@joel-rieke
joel-rieke merged commit 99894fb into main Jan 28, 2026
9 of 12 checks passed
@joel-rieke
joel-rieke deleted the alert-autofix-262 branch January 28, 2026 18:28
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