Skip to content

Commit 8d46d3a

Browse files
titusfortnerclaude
andcommitted
[build] address PR review feedback for commit-changes workflow
- Fix typo in pre-release.yml comment ("Run rust jobs run" -> "Run rust jobs") - Improve error handling in commit-changes.yml: replace set -e with explicit error checking to ensure committed output is always set before exit Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6fc96bb commit 8d46d3a

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/commit-changes.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,31 @@ jobs:
5151
- name: Apply and commit
5252
id: commit
5353
run: |
54-
set -e
5554
if [ -f changes.patch ] && [ -s changes.patch ]; then
56-
git apply --index changes.patch
55+
if ! git apply --index changes.patch; then
56+
echo "::error::Failed to apply patch"
57+
echo "committed=false" >> "$GITHUB_OUTPUT"
58+
exit 1
59+
fi
5760
git config --local user.email "selenium-ci@users.noreply.github.com"
5861
git config --local user.name "Selenium CI Bot"
59-
git commit -m "$COMMIT_MESSAGE"
62+
if ! git commit -m "$COMMIT_MESSAGE"; then
63+
echo "::error::Failed to commit changes"
64+
echo "committed=false" >> "$GITHUB_OUTPUT"
65+
exit 1
66+
fi
6067
if [ -n "$PUSH_BRANCH" ]; then
61-
git push origin HEAD:"$PUSH_BRANCH" --force
68+
if ! git push origin HEAD:"$PUSH_BRANCH" --force; then
69+
echo "::error::Failed to push to $PUSH_BRANCH"
70+
echo "committed=false" >> "$GITHUB_OUTPUT"
71+
exit 1
72+
fi
6273
else
63-
git push
74+
if ! git push; then
75+
echo "::error::Failed to push"
76+
echo "committed=false" >> "$GITHUB_OUTPUT"
77+
exit 1
78+
fi
6479
fi
6580
echo "::notice::Changes committed and pushed"
6681
echo "committed=true" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)