Skip to content

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

Merged
kare merged 1 commit into
mainfrom
alert-autofix-2
Jul 28, 2025
Merged

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#22
kare merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@kare

@kare kare commented Jul 28, 2025

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/kare/vanity/security/code-scanning/2

To fix the problem, you should add a permissions block to the workflow file .github/workflows/release-created.yaml. Since the job is using a reusable workflow, the permissions should be set at the workflow root level to apply to all jobs unless overridden. The minimal starting point is to set contents: read, which allows the workflow to read repository contents but not write. If the workflow needs to create or update pull requests, you can add pull-requests: write. However, unless you know the workflow needs more, start with the minimal permissions. Add the following block after the name: key and before the on: key:

permissions:
  contents: read

This change is sufficient to address the CodeQL warning and follows GitHub's least privilege principle.

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>
@github-actions github-actions Bot added the ci Continuous Integration label Jul 28, 2025
@kare kare marked this pull request as ready for review July 28, 2025 15:17
@kare kare merged commit 0825cf4 into main Jul 28, 2025
5 checks passed
@kare kare deleted the alert-autofix-2 branch July 28, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant