Skip to content

Conversation

@jwag956
Copy link
Collaborator

@jwag956 jwag956 commented Dec 27, 2025

Potential fix for https://github.com/pallets-eco/flask-security/security/code-scanning/19

In general, the fix is to explicitly define a minimal permissions block for the build job so that the GITHUB_TOKEN is restricted to only what the job actually needs. For this job, it only needs to read the repository contents (for actions/checkout) and does not push commits, create releases, or modify issues, so contents: read is sufficient.

Concretely, in .github/workflows/publish.yaml, under jobs: build:, add a permissions: section with contents: read. Place it alongside runs-on and outputs, not under steps. No other functionality needs to change, and no additional imports or dependencies are required. The other jobs (create-release and publish-pypi) already have appropriately scoped permissions and should remain as they are.

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

…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Chris Wagner <[email protected]>
@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.52%. Comparing base (2b05b49) to head (0d5ba30).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1161   +/-   ##
=======================================
  Coverage   98.52%   98.52%           
=======================================
  Files          40       40           
  Lines        5008     5008           
=======================================
  Hits         4934     4934           
  Misses         74       74           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +9 to +10
permissions:
contents: read

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably put this on the top level as a default for all jobs that don't specify something else

@jwag956 jwag956 marked this pull request as ready for review December 27, 2025 21:32
@jwag956 jwag956 merged commit c12fe92 into main Dec 27, 2025
20 checks passed
@jwag956 jwag956 deleted the alert-autofix-19 branch December 27, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants