Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#3

Merged
olangriffin merged 1 commit intomainfrom
alert-autofix-1
Nov 29, 2025
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#3
olangriffin merged 1 commit intomainfrom
alert-autofix-1

Conversation

@olangriffin
Copy link
Owner

Potential fix for https://github.com/olangriffin/open-source-web-dev/security/code-scanning/1

To resolve the issue, set the GitHub Actions job's GITHUB_TOKEN permissions explicitly using the permissions keyword. The principal place to do so is directly beneath the workflow root for all jobs (recommended for simplicity), or beneath the specific job (e.g. build:) if finer control is desired. For this workflow, the least privilege for the shown steps is contents: read, which allows read-only access to repository code and metadata but no write access. Add the following block after the workflow name, before or after the on: trigger section:

permissions:
  contents: read

No functional changes are needed elsewhere.


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>
@olangriffin olangriffin marked this pull request as ready for review November 29, 2025 20:51
@olangriffin olangriffin merged commit 62bd016 into main Nov 29, 2025
3 checks passed
@olangriffin olangriffin deleted the alert-autofix-1 branch November 29, 2025 20:52
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