Commit 9681264
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 9681264
1 file changed
Lines changed: 3 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 67 | | |
71 | 68 | | |
72 | 69 | | |
| |||
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 78 | | |
85 | 79 | | |
86 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
| |||
0 commit comments