Skip to content

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

Merged
Amberg merged 1 commit intomainfrom
alert-autofix-1
Nov 20, 2025
Merged

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

Conversation

@Amberg
Copy link
Owner

@Amberg Amberg commented Nov 20, 2025

Potential fix for https://github.com/Amberg/DocxTemplater/security/code-scanning/1

To fix this problem, add an explicit permissions block to the workflow file. Since the workflow mainly reads repository contents and pushes NuGet packages externally, the minimal required permission is likely contents: read. This block should be placed at the root level, just below the name (line 1) and before the on definition (line 2), or immediately after on. Doing so ensures all jobs inherit this minimal permission set unless they have their own explicit permissions block. No functionality will be affected—this change simply restricts what the workflow can do to the minimal safe set.

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>
@Amberg Amberg marked this pull request as ready for review November 20, 2025 10:49
@Amberg Amberg merged commit 2d81ff4 into main Nov 20, 2025
4 checks passed
@Amberg Amberg deleted the alert-autofix-1 branch December 16, 2025 10:48
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