Skip to content

Fix spell check workflow permissions#1440

Open
tas50 wants to merge 1 commit intomainfrom
fix-spellcheck-permissions
Open

Fix spell check workflow permissions#1440
tas50 wants to merge 1 commit intomainfrom
fix-spellcheck-permissions

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 20, 2026

Summary

  • Add actions: read to the Report job so it can download artifacts from the spell check job
  • Add security-events: write to the Report job for SARIF upload
  • Add top-level permissions block for least-privilege defaults
  • Align all job permissions with the reference pattern

Test plan

  • Verify spell check workflow runs and the Report job can post comments on a PR

🤖 Generated with Claude Code

Add missing permissions for the Report job to download artifacts (actions:read)
and upload SARIF results (security-events:write). Also add top-level
permissions block and align spelling job permissions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review Bot left a comment

Choose a reason for hiding this comment

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

Workflow permission changes look reasonable but introduce potentially excessive permissions.

Comment on lines 7 to +10

permissions:
contents: read
pull-requests: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 warning — Top-level pull-requests: write grants write access to all jobs by default, but the spelling job only needs pull-requests: read. The job-level permission should take precedence, but having a broader top-level permission is misleading and could be a risk if new jobs are added without explicit permissions. Consider setting the top-level to pull-requests: read and only granting write at the job level where needed (i.e., the comment job).

pull-requests: read
actions: read
security-events: write
outputs:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 suggestionsecurity-events: write is added to both the spelling and comment jobs. This is unusual for a spell-check workflow. If the underlying action (check-spelling) doesn't actually use the Security tab / code scanning alerts, this permission should be removed to follow the principle of least privilege.

contents: write
actions: read
contents: read
pull-requests: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 warning — The comment job's contents permission was downgraded from write to read. Make sure the check-spelling action's comment/follow-up step doesn't need to push commits (e.g., applying spelling fixes). If it only posts PR comments, read is correct; otherwise this will cause a permissions error at runtime.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 20, 2026

Test Results

  7 files  ±0   44 suites  ±0   1h 30m 49s ⏱️ -8s
430 tests ±0  428 ✅  - 2  0 💤 ±0  2 ❌ +2 
496 runs  ±0  484 ✅  - 6  6 💤 ±0  6 ❌ +6 

For more details on these failures, see this check.

Results for commit d3846d5. ± Comparison against base commit fb35cc4.

♻️ This comment has been updated with latest results.

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