Skip to content

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

Merged
totoprayogo1916 merged 1 commit into
4.5.xfrom
alert-autofix-17592
Oct 29, 2025
Merged

totoprayogo1916 merged 1 commit into
4.5.xfrom
alert-autofix-17592

Conversation

@totoprayogo1916

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/ataslangit/sistem-informasi-desa/security/code-scanning/17592

The best way to fix this issue is to explicitly specify the required permissions for the job or the workflow. In this case, the workflow performs documentation deployment by using a deploy key via peaceiris/actions-gh-pages@v4, meaning that the workflow likely does not need write privileges on the GITHUB_TOKEN. The minimal safe permissions are contents: read. You should add a permissions block at the workflow root (for all jobs) or at the job level (under build:). Adding it at the root applies strict permissions to all jobs unless a job overrides them, which is usually preferable for consistent security. Insert the following after the name: line and before the on: block in .github/workflows/deploy-docs.yml:

permissions:
  contents: read

The file to edit is .github/workflows/deploy-docs.yml. No additional imports, method or variable definitions, or dependencies are needed.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ntain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@totoprayogo1916
totoprayogo1916 marked this pull request as ready for review October 29, 2025 12:15
@totoprayogo1916
totoprayogo1916 merged commit 494a80a into 4.5.x Oct 29, 2025
5 checks passed
@totoprayogo1916
totoprayogo1916 deleted the alert-autofix-17592 branch October 29, 2025 12:18
@totoprayogo1916 totoprayogo1916 added abaikan-rilis Abaikan pada rilis info github_actions Pull requests that update GitHub Actions code labels Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

abaikan-rilis Abaikan pada rilis info github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant