feat: draft releases, version verification, and reusable workflows#396
Conversation
WalkthroughThe PR updates two GitHub Actions workflows: it adds version verification for tag-based releases in the main publishing pipeline and replaces an inline PR title validation job with a delegated reusable workflow call, including associated permission adjustments. ChangesRelease Verification and Publishing Flow
PR Title Validation Workflow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 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.
Pull request overview
This PR refactors CI/CD workflow definitions by moving PR-title validation and release undrafting into reusable workflows, and adds a version-verification gate before npm publishing. In the broader codebase, this centralizes release automation while tightening the release pipeline around tagged publishes.
Changes:
- Replaced the inline PR title validation job with a reusable workflow from
openfga/sdk-generator. - Added a
verify-versionjob to compare release metadata before npm publish. - Replaced the local release-creation job with a reusable workflow that undrafts the release after publish.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/pr-title-conventional-commit.yml |
Swaps the local PR title validation job for a reusable workflow. |
.github/workflows/main.yaml |
Adds version verification before publish and replaces release creation with reusable undraft logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/main.yaml (1)
133-140:⚠️ Potential issue | 🔴 Critical | ⚡ Quick win
env.NODE_VERSIONis undefined — publish job runs on an unintended Node version.The workflow only declares
TARGET_NODE_VERSION(line 13).${{ env.NODE_VERSION }}here expands to an empty string, soactions/setup-nodefalls back to whatever Node is preinstalled on the runner image rather than the pinned24.xused bytestandaudit. Releases will be built/published against an unspecified Node major. Although this line predates the PR, the newverify-version → publishchain means every tag now flows through this misconfigured step.🐛 Proposed fix
- name: Set up node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ env.TARGET_NODE_VERSION }} registry-url: "https://registry.npmjs.org" scope: "@openfga" always-auth: false cache: "npm"🤖 Prompt for 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. In @.github/workflows/main.yaml around lines 133 - 140, The workflow's actions/setup-node step is using an undefined env variable env.NODE_VERSION causing an unintended Node version; update that step to reference the declared TARGET_NODE_VERSION (or set NODE_VERSION = TARGET_NODE_VERSION in the workflow env) so node-version uses the pinned value (e.g., ${{ env.TARGET_NODE_VERSION }}) and ensure the actions/setup-node invocation (the step using actions/setup-node@...) uses that corrected variable.
🤖 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/main.yaml:
- Around line 177-182: Remove the failing job `undraft-release` from the
workflow YAML: delete the `undraft-release` job block (the job named
"undraft-release" that contains the `uses:
openfga/sdk-generator/.github/workflows/undraft-release.yml@main` reference and
its `if`, `needs`, and `permissions` keys) so the workflow no longer references
the non-existent `undraft-release.yml`; if undrafting is still required, instead
replace that `uses:` entry with a valid existing workflow path or add the
correct workflow file to the `openfga/sdk-generator` repo before re-adding the
job.
In @.github/workflows/pr-title-conventional-commit.yml:
- Around line 10-13: The reusable workflow reference for the job pr-title-check
points to openfga/sdk-generator/.github/workflows/pr-title-check.yml@main which
doesn't exist; fix by either adding the missing file pr-title-check.yml into the
target repo's .github/workflows directory or update the uses value to the
correct repo/path (or to a local reusable workflow reference ./
.github/workflows/pr-title-check.yml if the workflow should live in this repo),
and once the correct workflow location is set, replace the branch tag `@main` with
a specific commit SHA to pin the call per GitHub security guidance.
---
Outside diff comments:
In @.github/workflows/main.yaml:
- Around line 133-140: The workflow's actions/setup-node step is using an
undefined env variable env.NODE_VERSION causing an unintended Node version;
update that step to reference the declared TARGET_NODE_VERSION (or set
NODE_VERSION = TARGET_NODE_VERSION in the workflow env) so node-version uses the
pinned value (e.g., ${{ env.TARGET_NODE_VERSION }}) and ensure the
actions/setup-node invocation (the step using actions/setup-node@...) uses that
corrected variable.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b0fa0962-a4b5-40d3-b2c2-cfa9b5aaa9e1
📒 Files selected for processing (2)
.github/workflows/main.yaml.github/workflows/pr-title-conventional-commit.yml
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
mainSummary by CodeRabbit