Skip to content

Commit b05d0c5

Browse files
devinfoleyclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 035cb8a commit b05d0c5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/refresh-lockfile.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ jobs:
5151
fi
5252
5353
- name: Create or update pull request
54+
id: upsert-pr
5455
env:
5556
GH_TOKEN: ${{ github.token }}
5657
run: |
5758
if git diff --quiet -- pnpm-lock.yaml; then
5859
echo "Lockfile unchanged, nothing to do."
60+
echo "pr_created=false" >> "$GITHUB_OUTPUT"
5961
exit 0
6062
fi
6163
@@ -79,8 +81,10 @@ jobs:
7981
else
8082
echo "PR #$existing already exists, branch updated via force push."
8183
fi
84+
echo "pr_created=true" >> "$GITHUB_OUTPUT"
8285
8386
- name: Enable auto-merge for lockfile PR
87+
if: steps.upsert-pr.outputs.pr_created == 'true'
8488
env:
8589
GH_TOKEN: ${{ github.token }}
8690
run: |

0 commit comments

Comments
 (0)