Repository navigation
Defer release commit+tag to finalize job - #166
Conversation
Move the version bump commit and tag creation out of the preflight job into a new finalize job that runs only after build, publish, and release all succeed. This prevents orphaned version commits and tags on main when downstream jobs fail. - Preflight: validate version, lint/test only — no commit/tag/push - Release: softprops/action-gh-release creates tag for workflow_dispatch - Finalize: bump package.json versions, refresh lockfile, commit to main Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Missing target_commitish may tag wrong commit
- Added
target_commitish: ${{ needs.preflight.outputs.ref }}to thesoftprops/action-gh-release@v2step so the tag is always created at the exact commit that was built.
- Added
- ✅ Fixed: Finalize runs formatting and lockfile refresh unconditionally
- Propagated the
changedstate from the node script toGITHUB_OUTPUTand addedif: steps.update_versions.outputs.changed == 'true'conditions to the formatting and lockfile refresh steps.
- Propagated the
Or push these changes by commenting:
@cursor push 5ce934a6e8
Preview (5ce934a6e8)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -257,6 +257,7 @@
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.preflight.outputs.tag }}
+ target_commitish: ${{ needs.preflight.outputs.ref }}
name: T3 Code v${{ needs.preflight.outputs.version }}
generate_release_notes: true
make_latest: true
@@ -290,12 +291,13 @@
with:
node-version-file: package.json
- - name: Update version strings
+ - id: update_versions
+ name: Update version strings
env:
RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
run: |
node --input-type=module -e '
- import { readFileSync, writeFileSync } from "node:fs";
+ import { readFileSync, writeFileSync, appendFileSync } from "node:fs";
const files = [
"apps/server/package.json",
@@ -314,15 +316,18 @@
}
}
+ appendFileSync(process.env.GITHUB_OUTPUT, `changed=${changed}\n`);
if (!changed) {
console.log("All package.json versions already match release version.");
}
'
- name: Format package.json files
+ if: steps.update_versions.outputs.changed == 'true'
run: bunx oxfmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
- name: Refresh lockfile
+ if: steps.update_versions.outputs.changed == 'true'
run: bun install
- name: Commit and push version bump- Set `target_commitish` from preflight ref when creating GitHub releases - Track whether package versions changed and expose it via step output - Run format, lockfile refresh, and bump commit only when changes exist
…ploy-paths ci(fork): deploy the portal when its contracts or shared imports change

Summary
mainwhen any downstream job failsmake_latest: truetosoftprops/action-gh-releaseso the action creates the tag forworkflow_dispatchtriggersHow it works
Test plan
workflow_dispatchflow: preflight validates → build/publish/release use--build-version/--app-versionflags → release action creates tag → finalize bumps package.json and pushes to mainpush tagflow: preflight validates → build/publish/release run → finalize no-ops if versions already match🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes the release automation flow (tagging/target commit, version bump commits, and lockfile updates), which can break or mis-tag releases if misconfigured.
Overview
Release workflow now defers repo mutations until after a successful release.
preflightno longer bumps versions/lockfile or creates/pushes tags; downstream jobs build/publish from${{ github.sha }}captured asneeds.preflight.outputs.ref.GitHub Release publishing is adjusted. The release step now sets
target_commitishto the captured ref and enablesmake_latest: true, and a newfinalizejob updates package versions onmain, refreshesbun.lock, and commits/pushes the version bump only when changes are detected.CLI npm publish metadata is expanded.
apps/server/package.jsongains arepositoryfield, andapps/server/scripts/cli.tsnow includesrepositoryandbinwhen generating the temporary publishpackage.json.Written by Cursor Bugbot for commit 630be05. This will update automatically on new commits. Configure here.
Note
Defer release commit and tag to a finalize job by updating GitHub Actions workflow to publish against
github.shaand mark the release as latestUpdate release workflow to publish releases against
github.sha, addmake_latest: true, and move version bump, lockfile refresh, and commit to a new finalize job onmain. Include repository metadata inapps/serverand passrepositoryandbinthrough thepublishCmdpackage.json payload.📍Where to Start
Start with the release flow changes in .github/workflows/release.yml, then review the
publishCmdlogic in apps/server/scripts/cli.ts.Macroscope summarized 630be05.