Skip to content

Commit 1fd38a4

Browse files
committed
Improve logging
1 parent bf301d1 commit 1fd38a4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/rebuild.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,19 @@ jobs:
3636
git fetch origin "$BASE_BRANCH"
3737
3838
# Allow merge conflicts in `lib`, since rebuilding should resolve them.
39-
git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected"
39+
git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected, continuing..."
4040
4141
# Check for merge conflicts outside of `lib`. Disable git diff's trailing whitespace check
4242
# since `node_modules/@types/semver/README.md` fails it.
4343
if git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/'; then
44-
echo "Merge conflicts detected outside of lib/ directory. Please resolve them manually."
44+
echo "Merge conflicts were detected outside of the lib directory. Please resolve them manually."
4545
git -c core.whitespace=-trailing-space diff --check | grep --invert-match '^lib/' || true
4646
exit 1
4747
fi
4848
49+
echo "No merge conflicts found outside the lib directory. We should be able to resolve all of" \
50+
"these by rebuilding the Action."
51+
4952
- name: Compile TypeScript
5053
run: |
5154
npm install
@@ -70,18 +73,24 @@ jobs:
7073
BRANCH: ${{ github.event.pull_request.head.ref || github.event.ref }}
7174
run: |
7275
if [ ! -z "$(git status --porcelain)" ]; then
76+
echo "Changes detected, pushing them to branch $BRANCH"
7377
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
7478
git config --global user.name "github-actions[bot]"
7579
git add --all
7680
# If the merge originally had conflicts, finish the merge.
7781
# Otherwise, just commit the changes.
7882
if git rev-parse --verify MERGE_HEAD >/dev/null 2>&1; then
83+
echo "In progress merge detected, finishing it up."
7984
git merge --continue
8085
else
86+
echo "No in-progress merge detected, committing changes."
8187
git commit -m "Rebuild"
8288
fi
89+
echo "Pushing changes to branch $BRANCH"
8390
git push origin "HEAD:$BRANCH"
8491
echo "changes=true" >> $GITHUB_OUTPUT
92+
else
93+
echo "No changes detected, nothing to commit."
8594
fi
8695
8796
- name: Notify about rebuild

0 commit comments

Comments
 (0)