Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

chore: update tend workflows (#2302)

Worktrunk Bot091bcfbd2fee
diff --git a/.github/workflows/tend-review.yaml b/.github/workflows/tend-review.yaml
index 1e6f08812..c0a877a23 100644
--- a/.github/workflows/tend-review.yaml
+++ b/.github/workflows/tend-review.yaml
@@ -26,9 +26,26 @@ jobs:
actions: read
issues: write
steps:
+ # GitHub only materializes refs/pull/N/merge for mergeable PRs — on
+ # conflicting PRs it 404s and every downstream step cascades as skipped.
+ # Probe first and fall back to /head so review always runs; on fallback
+ # the review sees the PR branch in isolation rather than the post-merge
+ # tree.
+ - name: Resolve PR checkout ref
+ id: pr_ref
+ env:
+ GH_TOKEN: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
+ PR: ${{ github.event.pull_request.number }}
+ run: |
+ if gh api "repos/${{ github.repository }}/git/ref/pull/$PR/merge" --silent 2>/dev/null; then
+ echo "ref=refs/pull/$PR/merge" >> "$GITHUB_OUTPUT"
+ else
+ echo "ref=refs/pull/$PR/head" >> "$GITHUB_OUTPUT"
+ echo "::notice::refs/pull/$PR/merge unavailable (likely merge conflict); falling back to /head"
+ fi
- uses: actions/checkout@v6
with:
- ref: refs/pull/${{ github.event.pull_request.number }}/merge
+ ref: ${{ steps.pr_ref.outputs.ref }}
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.WORKTRUNK_BOT_TOKEN }}