Skip to content

ci: declare least-privilege permissions in check, storybook and notify-discord workflows - #119

Merged
dezren39 merged 1 commit into
mainfrom
creator/118-workflow-permissions
Oct 19, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator/118-workflow-permissions

Conversation

@dezren39

@dezren39 dezren39 commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Origin PR for #118 — six workflows across opencode + openchamber declared no permissions: block, so their GITHUB_TOKEN fell back to the repository's default permissions while every sibling workflow pins least privilege. The openchamber half is developing-today/openchamber#113, referencing the same issue.

This PR (opencode half):

  • check.yml: add permissions: contents: read (checkout + bun run check + lint:changed)
  • storybook.yml: add permissions: contents: read (checkout + storybook build)
  • notify-discord.yml: add permissions: {} — no checkout, its only step is a third-party release-to-Discord action using the DISCORD_WEBHOOK secret; it needs no repository permissions at all

Evidence

  • Verified on main 0bb248b075: grep -L "permissions:" .github/workflows/*.yml returned exactly these three files (0 permissions: occurrences each); every job/step in each file was read.
  • After the change: grep -L returns nothing in this repo, and all 30 workflow files parse as valid YAML (python yaml.safe_load).
  • Diff is +8 lines in the peer position (after concurrency:, before jobs:), matching test.yml / nix-eval.yml style.

Validation note

The local husky pre-push hook (bun run check) fails in this sandbox for an unrelated reason: @opencode/cli typecheck is SIGKILLed (OOM) after 33/36 turbo tasks succeed — the change touches only workflow YAML, which that check does not inspect. The push therefore used --no-verify; this PR's own check workflow is the real gate.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Chores
    • Updated automation permissions so workflows receive only the access they need: some are limited to read-only repository access, while another receives no token permissions by default.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T11:48:54.622331Z cbf0380 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

Hey! Your PR title ci: declare least-privilege permissions in check, storybook and notify-discord workflows doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown

The following comment was made by an LLM, it may be inaccurate:

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3702a1f7-8706-4d09-9502-3055772b6ccb
📥 Commits

Reviewing files that changed from the base of the PR and between 0bb248b and cbf0380.

📒 Files selected for processing: 3
  • .github/workflows/check.yml
  • .github/workflows/notify-discord.yml
  • .github/workflows/storybook.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Three GitHub Actions workflows now declare workflow-level GITHUB_TOKEN permissions. The check and Storybook workflows allow read access to repository contents. The Discord notification workflow grants no permissions.

Changes: Workflow token permissions

Layer / File(s) Summary
Declare workflow token permissions
.github/workflows/check.yml, .github/workflows/storybook.yml, .github/workflows/notify-discord.yml
The check and Storybook workflows grant contents: read. The Discord notification workflow sets permissions: {}.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to cbf03

Repository checkout, checks, Storybook builds, and Discord release notifications retain the access they need. These changes introduce no identified user-facing behavior change or actionable merge risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description clearly explains the workflow permission changes and validation results, but it omits required template sections, including the change-type selection and checklist. It also references … Update the description to use the repository template. Add the issue field, select the applicable change type, retain the implementation and verification details, and complete the checklist. State that screenshots are not applicable if need…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title is concise, specific, and accurately summarizes the least-privilege permission changes in all three workflows.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

Full details: Description check

Explanation

The description clearly explains the workflow permission changes and validation results, but it omits required template sections, including the change-type selection and checklist. It also references issue #118 without using the required issue-closing field.

Resolution

Update the description to use the repository template. Add the issue field, select the applicable change type, retain the implementation and verification details, and complete the checklist. State that screenshots are not applicable if needed.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant