Skip to content

Commit 378e4b3

Browse files
authored
Merge pull request #3568 from github/henrymercer/fix-rebuild
Fix rebuild Action
2 parents 309fd2a + 567ca73 commit 378e4b3

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/rebuild.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ jobs:
2929
fetch-depth: 0
3030
ref: ${{ env.HEAD_REF }}
3131

32+
- name: Set up Node.js
33+
uses: actions/setup-node@v6
34+
with:
35+
node-version: 24
36+
cache: 'npm'
37+
cache-dependency-path: |
38+
package-lock.json
39+
pr-checks/package-lock.json
40+
3241
- name: Remove label
3342
if: github.event_name == 'pull_request'
3443
env:
@@ -49,9 +58,18 @@ jobs:
4958
git fetch origin "$BASE_BRANCH"
5059
5160
# Allow merge conflicts in `lib`, since rebuilding should resolve them.
52-
git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected, continuing."
61+
git merge "origin/$BASE_BRANCH"
5362
MERGE_RESULT=$?
5463
64+
if [ "$MERGE_RESULT" -eq 0 ]; then
65+
echo "Merge succeeded cleanly."
66+
elif [ "$MERGE_RESULT" -eq 1 ]; then
67+
echo "Merge conflicts detected (exit code $MERGE_RESULT), continuing."
68+
else
69+
echo "git merge failed with unexpected exit code $MERGE_RESULT."
70+
exit 1
71+
fi
72+
5573
if [ "$MERGE_RESULT" -ne 0 ]; then
5674
echo "merge-in-progress=true" >> $GITHUB_OUTPUT
5775
@@ -104,7 +122,7 @@ jobs:
104122
# Otherwise, just commit the changes.
105123
if git rev-parse --verify MERGE_HEAD >/dev/null 2>&1; then
106124
echo "In progress merge detected, finishing it up."
107-
git merge --continue --no-edit
125+
git commit --no-edit
108126
else
109127
echo "No in-progress merge detected, committing changes."
110128
git commit -m "Rebuild"

0 commit comments

Comments
 (0)