fix: clean up reusable workflow inputs and bump action versions (INT-1582)#3
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request updates GitHub Actions workflows: lint and tf-test remove required ChangesWorkflow Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release-please.yaml:
- Around line 27-31: The create-github-app-token step (uses:
actions/create-github-app-token@..., id: generate-token) currently inherits all
installation permissions; update that step to pass explicit permission-<name>
inputs to scope the token to least privilege required by the release workflow
(for example add permission-contents: write, permission-pull-requests: write,
permission-issues: write and permission-metadata: read) so the generated token
only grants those specific rights instead of all installation permissions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: efba5c93-3f69-4e53-891b-59a715b79a69
📒 Files selected for processing (4)
.github/workflows/lint.yaml.github/workflows/release-please.yaml.github/workflows/tf-test.yaml.github/workflows/zizmor.yaml
💤 Files with no reviewable changes (2)
- .github/workflows/zizmor.yaml
- .github/workflows/tf-test.yaml
## what - Refactor workflows to utilize reusable/centralized workflows in our actions repo - Pass in `GITHUB_TOKEN` to zizmor plugin within trunk ## why - Align this repo with our centralized standard workflows - During testing, I found that the zizmor plugin did not work properly within the context of GHA, because it needs the `GITHUB_TOKEN` to read contents from the repo. Since it's optional, it still works locally as well. - **Note on permissions**: Caller-job permissions act as a ceiling — the reusable workflow can scope down within them, but cannot exceed them. Although not strictly required (can be omitted in actions repo), declaring permissions in both places makes it clear where each scope is needed and why. - **Note the usage of `@SHA #VER`, since this is dependent on centralized workflow repo [changes](masterpointio/actions#3 ## references - [INT-1582](https://www.notion.so/masterpoint/Roll-out-Zizmor-across-all-Masterpoint-OSS-repos-08a6992b18de4b9581bec3eb579715b1) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Refactored multiple GitHub Actions workflows to use reusable workflow templates for improved maintainability. * Removed the zizmor security analysis workflow. * Updated Trunk CLI plugin version and added zizmor as an enabled lint tool with pedantic mode configuration. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/masterpointio/terraform-spacelift-automation/pull/132) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
what
head-refinput andGITHUB_TOKENsecret from workflow_call.refs/pull/{number}/mergefetch-depth: 0v3.2.0and googleapis/release-please-action tov5.0.0.GITHUB_TOKENsecret from workflow_call.why
head-refinput andGITHUB_TOKENare already available in the context of the workflow run, and there was no need to pass these inrefs/pull/{number}/mergeso callers triggering onpull_request_targetlint the feature-branch code (no-op forpull_requestcallers).fetch-depth: 0so Trunk can compute the PR diff against the base — the default shallow clone has no merge-base, and persist-credentials: false strips the token before Trunk's on-the-fly fetch can succeed.references
Summary by CodeRabbit