Skip to content

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

Merged
olstakh merged 1 commit intomainfrom
alert-autofix-1
Apr 28, 2026
Merged

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

Conversation

@olstakh
Copy link
Copy Markdown
Owner

@olstakh olstakh commented Apr 28, 2026

Potential fix for https://github.com/olstakh/ReferenceProtector/security/code-scanning/1

Add an explicit permissions block in .github/workflows/pr.yml so the workflow does not rely on inherited defaults.

Best fix (without changing behavior): define workflow-level permissions right after the on: trigger section and before jobs::

  • contents: read (required baseline for checkout and repository reads)

This applies to all jobs in the workflow (currently just build) and preserves existing functionality while enforcing least privilege. No imports, methods, or additional definitions are needed.

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>
@olstakh olstakh marked this pull request as ready for review April 28, 2026 07:28
@olstakh olstakh merged commit 0ee816c into main Apr 28, 2026
5 checks passed
@olstakh olstakh deleted the alert-autofix-1 branch April 28, 2026 07:29
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