Skip to content

.github/workflows/docs-pages.yaml: Potential fix for code scanning alert no. 1: Workflow does not contain permissions#2747

Draft
mykaul wants to merge 1 commit intomasterfrom
github/workflows/docs-pages.yaml-alert-autofix-1
Draft

.github/workflows/docs-pages.yaml: Potential fix for code scanning alert no. 1: Workflow does not contain permissions#2747
mykaul wants to merge 1 commit intomasterfrom
github/workflows/docs-pages.yaml-alert-autofix-1

Conversation

@mykaul
Copy link
Contributor

@mykaul mykaul commented Dec 24, 2025

Potential fix for https://github.com/scylladb/scylla-monitoring/security/code-scanning/1

In general, the fix is to explicitly declare GitHub Actions permissions for the GITHUB_TOKEN in this workflow, limiting them to only what the docs publishing process requires. This is done by adding a permissions: block either at the root (applies to all jobs) or under the specific job (release:). Since there is only one job and it’s the one using the token, adding a job-level permissions block is the minimal, targeted change.

The best concrete fix here is to add permissions under jobs.release so that GITHUB_TOKEN has contents: write and nothing broader. The deploy script is almost certainly pushing built documentation to a branch (such as gh-pages) or otherwise updating repository contents, which requires contents: write; it does not obviously need other scopes like issues or pull-requests. Therefore, in .github/workflows/docs-pages.yaml, directly under release: and at the same indentation level as runs-on:, add:

    permissions:
      contents: write

No imports or new methods are needed; this is purely a YAML configuration change within the GitHub Actions workflow.

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>
@mykaul mykaul changed the title Potential fix for code scanning alert no. 1: Workflow does not contain permissions .github/workflows/docs-pages.yaml: Potential fix for code scanning alert no. 1: Workflow does not contain permissions Dec 24, 2025
@mykaul mykaul requested a review from annastuchlik January 6, 2026 07:59
@annastuchlik annastuchlik added the documentation Documentation related label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments