Skip to content

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

Merged
luolingchun merged 1 commit into
mainfrom
alert-autofix-1
Oct 10, 2026
Merged

luolingchun merged 1 commit into
mainfrom
alert-autofix-1

Conversation

@luolingchun

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/luolingchun/flask-openapi/security/code-scanning/1

Add an explicit permissions block to .github/workflows/publish.yml at the workflow root, setting least privilege required. For this workflow, contents: read is the minimal appropriate baseline and matches CodeQL guidance. This preserves existing functionality because publishing uses UV_PUBLISH_TOKEN from secrets, not GITHUB_TOKEN write scopes.

Best single fix:

  • Edit .github/workflows/publish.yml
  • Insert immediately after the on: trigger section (before jobs:):
    • permissions:
    • contents: read

No imports, methods, or dependencies are needed.

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>
@luolingchun
luolingchun marked this pull request as ready for review October 10, 2026 08:00
@luolingchun
luolingchun merged commit f6ff7cd into main Oct 10, 2026
4 checks passed
@luolingchun
luolingchun deleted the alert-autofix-1 branch October 10, 2026 08:01
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