Skip to content

Potential fix for code scanning alert no. 5: Workflow does not contain permissions#298

Merged
lgcorzo merged 1 commit into
mainfrom
alert-autofix-5
Apr 11, 2026
Merged

Potential fix for code scanning alert no. 5: Workflow does not contain permissions#298
lgcorzo merged 1 commit into
mainfrom
alert-autofix-5

Conversation

@lgcorzo
Copy link
Copy Markdown
Owner

@lgcorzo lgcorzo commented Apr 11, 2026

Potential fix for https://github.com/lgcorzo/mlops-python-package/security/code-scanning/5

Add an explicit permissions block to the pages job so the token scopes are minimal and explicit for that job.
Best single fix without changing behavior: define only the permissions needed by pages:

  • contents: read (needed by actions/checkout)
  • pages: write (needed by github-pages-deploy-action to publish)
  • id-token: write (commonly required for pages-related deploy/auth flows)

This keeps existing functionality while enforcing least privilege and resolving the CodeQL finding at the highlighted job.
Edit file: .github/workflows/publish.yml in the jobs.pages section, inserting permissions: under pages: and before runs-on:.

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>
@lgcorzo lgcorzo marked this pull request as ready for review April 11, 2026 21:06
@lgcorzo lgcorzo merged commit 0d8d10c into main Apr 11, 2026
4 checks passed
@lgcorzo lgcorzo deleted the alert-autofix-5 branch April 11, 2026 21:06
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