Skip to content

Commit bd8b95a

Browse files
Trotttargos
authored andcommitted
tools: remove last of error-masking in commit-queue.sh
Remove the lats of the unintentional error-masking in commit-queue.sh. With this change, `tools/lint-sh.js . --from-npx` at last passes. PR-URL: #41356 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 9284d24 commit bd8b95a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/actions/commit-queue.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,14 @@ for pr in "$@"; do
8383
else
8484
# If there's only one commit, we can use the Squash and Merge feature from GitHub.
8585
# TODO: use `gh pr merge` when the GitHub CLI allows to customize the commit title (https://github.com/cli/cli/issues/1023).
86+
commit_title=$(git log -1 --pretty='format:%s')
87+
commit_body=$(git log -1 --pretty='format:%b')
88+
commit_head=$(grep 'Fetched commits as' output | cut -d. -f3 | xargs git rev-parse)
89+
8690
jq -n \
87-
--arg title "$(git log -1 --pretty='format:%s')" \
88-
--arg body "$(git log -1 --pretty='format:%b')" \
89-
--arg head "$(grep 'Fetched commits as' output | cut -d. -f3 | xargs git rev-parse)" \
91+
--arg title "${commit_title}" \
92+
--arg body "${commit_body}" \
93+
--arg head "${commit_head}" \
9094
'{merge_method:"squash",commit_title:$title,commit_message:$body,sha:$head}' > output.json
9195
cat output.json
9296
if ! gh api -X PUT "repos/${OWNER}/${REPOSITORY}/pulls/${pr}/merge" --input output.json > output; then

0 commit comments

Comments
 (0)