Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#153

Open
twwd wants to merge 1 commit intomainfrom
alert-autofix-2
Open

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#153
twwd wants to merge 1 commit intomainfrom
alert-autofix-2

Conversation

@twwd
Copy link
Collaborator

@twwd twwd commented Aug 27, 2025

Potential fix for https://github.com/iteratec/kcwarden/security/code-scanning/2

To fix the problem, add an explicit permissions block to the test-and-build job to restrict the GITHUB_TOKEN permissions to the minimum required. Since the job does not appear to push, write, or modify any repository resources, the minimal contents: read permission is sufficient. The change should be made under the test-and-build: job definition, at the same indentation level as runs-on. This does not affect existing functionality―the job and steps remain unchanged.

  • Add:
    permissions:
      contents: read
    immediately under:
    test-and-build:
      runs-on: ubuntu-latest

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>
@twwd twwd force-pushed the alert-autofix-2 branch from d38eb04 to 0ed8753 Compare March 13, 2026 14:11
@twwd twwd marked this pull request as ready for review March 13, 2026 14:12
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.

1 participant