Skip to content

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

Merged
Lawrence Lucas Large (LukeLarge) merged 1 commit into
mainfrom
alert-autofix-2
Dec 4, 2025
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#5
Lawrence Lucas Large (LukeLarge) merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@LukeLarge

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/LukeLarge/token-contract/security/code-scanning/2

To fix the problem, we should add a permissions block explicitly granting only the minimum required permissions to the GITHUB_TOKEN. In this case, that is likely contents: read since no workflow steps require repository write access.

The most maintainable way is to add this at the workflow root (after the name: but before on: or env:), to ensure all jobs inherit it unless overridden. This requires editing the top portion of .github/workflows/azure-functions-app-nodejs.yml to insert:

permissions:
  contents: read

No additional imports, method or variable definitions are needed. Only a single YAML block should be added to the workflow file.


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>
@LukeLarge
Lawrence Lucas Large (LukeLarge) marked this pull request as ready for review December 4, 2025 10:34
@LukeLarge
Lawrence Lucas Large (LukeLarge) merged commit 3adeec1 into main Dec 4, 2025
3 checks passed
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