From b05d0c560e13a0fe14efaddc3e1fe6d8cc473e18 Mon Sep 17 00:00:00 2001 From: Devin Foley Date: Thu, 19 Mar 2026 16:42:58 -0700 Subject: [PATCH] fix(ci): skip auto-merge step when lockfile is unchanged The "Enable auto-merge" step runs unconditionally, even when the lockfile didn't change and no PR exists. This causes the workflow to fail with "lockfile PR was not found." Use a step output to gate the auto-merge step so it only runs when a PR was actually created or updated. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/refresh-lockfile.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/refresh-lockfile.yml b/.github/workflows/refresh-lockfile.yml index 9f28fc28..7d2c9e45 100644 --- a/.github/workflows/refresh-lockfile.yml +++ b/.github/workflows/refresh-lockfile.yml @@ -51,11 +51,13 @@ jobs: fi - name: Create or update pull request + id: upsert-pr env: GH_TOKEN: ${{ github.token }} run: | if git diff --quiet -- pnpm-lock.yaml; then echo "Lockfile unchanged, nothing to do." + echo "pr_created=false" >> "$GITHUB_OUTPUT" exit 0 fi @@ -79,8 +81,10 @@ jobs: else echo "PR #$existing already exists, branch updated via force push." fi + echo "pr_created=true" >> "$GITHUB_OUTPUT" - name: Enable auto-merge for lockfile PR + if: steps.upsert-pr.outputs.pr_created == 'true' env: GH_TOKEN: ${{ github.token }} run: |