Skip to content

ci: add explicit workflow permissions - #290

Merged
lucemia merged 1 commit into
mainfrom
fix/workflow-permissions
Jul 29, 2026
Merged

lucemia merged 1 commit into
mainfrom
fix/workflow-permissions

Conversation

@lucemia

@lucemia lucemia commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Closes both open code scanning alerts (actions/missing-workflow-permissions, medium).

Workflow Permissions added Why
python-package.yml contents: read Test-only workflow — checkout is all it needs.
calibreapp-image-actions.yml contents: write, pull-requests: write image-actions commits compressed images back to the PR branch and posts a summary comment.

Without a top-level permissions block, the GITHUB_TOKEN falls back to the repo/org default, which can be write-all. These blocks pin each workflow to least privilege.

Verified both files still parse as valid YAML with the expected permissions values.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R6goePzwRXty3vY9xTr7uz

Fixes both open CodeQL `actions/missing-workflow-permissions` alerts by
setting a least-privilege top-level `permissions` block:

- python-package.yml: `contents: read` (test-only workflow)
- calibreapp-image-actions.yml: `contents: write` + `pull-requests: write`,
  since image-actions commits compressed images back to the PR branch and
  posts a summary comment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R6goePzwRXty3vY9xTr7uz
@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.65%. Comparing base (baf4f97) to head (82cbb89).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #290   +/-   ##
=======================================
  Coverage   88.65%   88.65%           
=======================================
  Files           3        3           
  Lines         291      291           
=======================================
  Hits          258      258           
  Misses         33       33           
Flag Coverage Δ
3.10 88.65% <ø> (ø)
3.11 88.65% <ø> (ø)
3.12 88.65% <ø> (ø)
3.13 88.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@lucemia
lucemia merged commit f899310 into main Jul 29, 2026
13 checks passed
@lucemia
lucemia deleted the fix/workflow-permissions branch July 29, 2026 01:51
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.

2 participants