feat(actions): add pr lifecycle workflow configuration#372
feat(actions): add pr lifecycle workflow configuration#372
Conversation
Signed-off-by: 0xisk <iskander.andrews@openzeppelin.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughA new GitHub Actions workflow is added to manage PR lifecycle events by delegating to a reusable template workflow, passing a project token for integration. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
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)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/pr-lifecycle.yml:
- Line 11: Replace the mutable branch ref in the reusable workflow invocation by
pinning the "uses" reference string
"OpenZeppelin/midnight-handbook/.github/workflows/pr-lifecycle-template.yml@main"
to a full immutable commit SHA: locate the "uses" entry in
.github/pr-lifecycle.yml and update the "@main" suffix to the exact commit SHA
(e.g., "@<commit-sha>") of the template repository, then commit the change so
the workflow calls that specific immutable revision.
- Around line 1-13: The workflow file defining "name: PR Lifecycle" and job
"pr-lifecycle" (which uses
OpenZeppelin/midnight-handbook/.github/workflows/pr-lifecycle-template.yml@main)
is placed in the wrong location and will never be picked up by GitHub Actions;
move this YAML into the repository's GitHub Actions workflows directory so
GitHub will load and run it, keeping the existing trigger block (pull_request
types), permissions, job name "pr-lifecycle" and secrets mapping intact.
- Around line 3-5: The workflow trigger uses pull_request which prevents access
to secrets for forked PRs; change the event key to pull_request_target (replace
pull_request: with pull_request_target:) so secrets.PROJECT_TOKEN is available
for fork PRs, and apply the same replacement for the other occurrence referenced
(lines 12-13); before merging, verify that the called workflow
(pr-lifecycle-template.yml) does not checkout or execute untrusted PR code to
avoid security risks when using pull_request_target.
Types of changes
What types of changes does your code introduce to OpenZeppelin Midnight Contracts?
Put an
xin the boxes that applyFixes #371
PR Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
Summary by CodeRabbit