Skip to content

fix: Workflow does not contain permissions#44

Merged
BenjaminMichaelis merged 1 commit into
mainfrom
alert-autofix-3
May 17, 2026
Merged

fix: Workflow does not contain permissions#44
BenjaminMichaelis merged 1 commit into
mainfrom
alert-autofix-3

Conversation

@BenjaminMichaelis
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/BenjaminMichaelis/TrxLib/security/code-scanning/3

Add an explicit permissions block for the build-and-test job in .github/workflows/build-and-test.yml, with the minimum required scope:

  • contents: read

This is the best fix because it preserves existing behavior (checkout/build/test still work) while ensuring GITHUB_TOKEN cannot get unintended write privileges from repo/org defaults.
Edit only the build-and-test job section, directly under runs-on.

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>
@BenjaminMichaelis BenjaminMichaelis changed the title Potential fix for code scanning alert no. 3: Workflow does not contain permissions fix: Workflow does not contain permissions May 17, 2026
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review May 17, 2026 05:10
Copilot AI review requested due to automatic review settings May 17, 2026 05:10
@BenjaminMichaelis BenjaminMichaelis merged commit 0419ec4 into main May 17, 2026
5 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the alert-autofix-3 branch May 17, 2026 05:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a GitHub code-scanning alert by explicitly setting minimal GITHUB_TOKEN permissions for the build-and-test job, preventing unintended elevated privileges inherited from repo/org defaults.

Changes:

  • Added a permissions block to the build-and-test job.
  • Set contents: read as the minimal required scope for checkout/build/test operations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

BenjaminMichaelis added a commit that referenced this pull request May 17, 2026
Potential fix for
[https://github.com/BenjaminMichaelis/TrxLib/security/code-scanning/3](https://github.com/BenjaminMichaelis/TrxLib/security/code-scanning/3)

Add an explicit `permissions` block for the `build-and-test` job in
`.github/workflows/build-and-test.yml`, with the minimum required scope:
- `contents: read`

This is the best fix because it preserves existing behavior
(checkout/build/test still work) while ensuring `GITHUB_TOKEN` cannot
get unintended write privileges from repo/org defaults.
Edit only the `build-and-test` job section, directly under `runs-on`.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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