Skip to content

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

Merged
kojix2 merged 1 commit into
mainfrom
alert-autofix-2
Oct 24, 2026
Merged

kojix2 merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@kojix2

@kojix2 kojix2 commented Oct 24, 2026

Copy link
Copy Markdown
Member

Potential fix for https://github.com/red-data-tools/YouPlot/security/code-scanning/2

Add an explicit permissions block in .github/workflows/doc.yml to enforce least privilege for GITHUB_TOKEN.

Best single fix without changing functionality:

  • Add a workflow-level permissions block right after on (or before jobs).
  • Set baseline read access for repository contents and grant only the write scope needed for publishing pages.
  • For this workflow, a practical least-privilege set is:
    • contents: write (required by gh-pages push action)
    • optionally leave other scopes unspecified (they default to none when permissions is explicitly set).

This keeps current behavior (documentation generation + publish) while removing reliance on potentially broad defaults.

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>
@kojix2
kojix2 marked this pull request as ready for review October 24, 2026 11:59
@kojix2
kojix2 merged commit 492d886 into main Oct 24, 2026
35 checks passed
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