Skip to content

ci(mixin): cap GITHUB_TOKEN to contents: read#5255

Closed
arpitjain099 wants to merge 1 commit into
prometheus:mainfrom
arpitjain099:chore/declare-workflow-perms
Closed

ci(mixin): cap GITHUB_TOKEN to contents: read#5255
arpitjain099 wants to merge 1 commit into
prometheus:mainfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown

@arpitjain099 arpitjain099 commented May 25, 2026

The mixin workflow only validates the alertmanager mixin (jsonnet). No GitHub API writes, so workflow-level contents: read is the right cap for the default GITHUB_TOKEN.

Post-CVE-2025-30066 (tj-actions/changed-files) hardening pattern. YAML validated locally.

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow security configuration.

Note: This release contains only internal infrastructure updates with no changes visible to end-users.

Review Change Stack

mixin workflow only validates the alertmanager mixin (jsonnet); no GitHub API writes. contents: read at workflow level is appropriate.

Post-CVE-2025-30066 hardening pattern. yaml.safe_load validated.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 25, 2026 03:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3c132511-52ea-437d-a81f-8aeecdf410b6

📥 Commits

Reviewing files that changed from the base of the PR and between 36afed4 and 76f1163.

📒 Files selected for processing (1)
  • .github/workflows/mixin.yml

📝 Walkthrough

Walkthrough

The PR adds an explicit top-level permissions block to the mixin workflow, granting read-only access to repository contents. This applies the principle of least privilege to restrict GitHub Actions token scope.

Changes

GitHub Actions Permissions Hardening

Layer / File(s) Summary
Workflow read-only permissions
.github/workflows/mixin.yml
Top-level permissions configuration grants contents: read, restricting token access to the minimum required scope.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the rationale for the change and references security context, but does not follow the repository's PR template structure with checklist items. Include the PR checklist from the template and mark applicable boxes; specify issue number if applicable or mark as N/A.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: restricting the GITHUB_TOKEN to contents:read in the mixin workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arpitjain099
Copy link
Copy Markdown
Author

Closing as duplicate of #5237 (earlier PR with overlapping scope), apologies for the noise.

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