Potential fix for code scanning alert no. 1: Workflow does not contain permissions #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
hacktoberfest-accepted
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
twodarek/arin-waitlist-prom!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "alert-autofix-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Potential fix for https://github.com/twodarek/arin-waitlist-prom/security/code-scanning/1
To fix this problem, we should add an explicit
permissionsblock specifying minimal required privileges for the workflow. Since the steps only involve checking out code, setting up Go, building, and testing (none of which require write access to the repository content or administrative permissions), the least privileged permission iscontents: read. The fix is to add apermissionssection either at the workflow root (so it applies globally to all jobs unless overridden), or directly inside thebuildjob. The best practice is to add it at the workflow root, immediately after the workflowname:declaration and before the triggers (on:), e.g., after line 4.Suggested fixes powered by Copilot Autofix. Review carefully before merging.