Commit 4b8fab3
committed
Fix the squash-commit idempotency check to resolve in real action runs
has_squash_commit compared the target with a bare branch name like "main".
actions/checkout leaves a detached HEAD and creates no local branches, so
"main" does not resolve and git exits 128, which the if silently reads as
"not up-to-date". The skip branch was therefore dead in CI and only worked
in tests, where the test repos have every branch locally.
This matters on the resume path: the push that finishes conflict resolution
fires a synchronize event while the conflict label is still on. If that
second run loses the race against the label removal, the broken check let it
re-run the whole merge and push a second redundant synthetic merge commit.
Compare against origin/$TARGET_BRANCH instead. With fetch-depth: 0 the
remote-tracking ref always exists, so the check works in production while
staying correct in tests.1 parent 2d2469a commit 4b8fab3
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
82 | | - | |
83 | | - | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | | - | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
0 commit comments