Skip to content

Potential fix for code scanning alert no. 6: Workflow does not contain permissions#20

Merged
JonathanPiaget merged 1 commit intomainfrom
alert-autofix-6
Oct 24, 2025
Merged

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

Conversation

@JonathanPiaget
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/JonathanPiaget/SearchMark/security/code-scanning/6

To fix this issue, an explicit permissions block should be added to the workflow to restrict the GITHUB_TOKEN according to the principle of least privilege. This can be done at the root of the workflow to apply to all jobs, with further customization at the job level if needed. In this workflow, jobs that read contents (checkout, versioning, submit to stores) only need contents: read, but the Release job (using softprops/action-gh-release) requires contents: write to create a release. The minimum fix is to add a root-level permissions block with contents: read, and override it with contents: write for the Release job. Edits should be made at the root level (after the name, before or after on:), and in the Release job spec.

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>
@JonathanPiaget JonathanPiaget marked this pull request as ready for review October 24, 2025 12:26
@JonathanPiaget JonathanPiaget merged commit 8858569 into main Oct 24, 2025
8 checks passed
@JonathanPiaget JonathanPiaget deleted the alert-autofix-6 branch October 24, 2025 12:26
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