Skip to content

Potential fix for code scanning alert no. 4: Workflow does not contain permissions - #332

Merged
garloff merged 3 commits into
mainfrom
alert-autofix-4
Dec 3, 2025
Merged

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#332
garloff merged 3 commits into
mainfrom
alert-autofix-4

Conversation

@garloff

@garloff garloff commented Nov 27, 2025

Copy link
Copy Markdown
Member

Potential fix for https://github.com/SovereignCloudStack/docs/security/code-scanning/4

To address the detected issue, we should explicitly add a permissions block to the workflow or the affected job. Because the "Deploy" step requires the workflow to push built assets to the gh-pages branch, it needs contents: write. All other operations should only need read permissions. To minimize the scope while allowing required functionality, add a permissions block to the build_and_deploy job:

permissions:
  contents: write

Place it directly under the job name (build_and_deploy:), before runs-on. No new dependencies, methods, or imports are required. This change ensures the GITHUB_TOKEN provided to the job is restricted to just contents: write and nothing broader.


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>
Signed-off-by: Kurt Garloff <kurt@garloff.de>
@garloff garloff self-assigned this Dec 2, 2025
@garloff
garloff requested a review from maxwolfs December 2, 2025 18:57
@garloff garloff added bug Something isn't working documentation Improvements or additions to documentation labels Dec 2, 2025
@garloff
garloff marked this pull request as ready for review December 2, 2025 18:57
@garloff
garloff merged commit 0a1b158 into main Dec 3, 2025
5 of 6 checks passed
@garloff
garloff deleted the alert-autofix-4 branch December 3, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants