Skip to content

Commit 9c41247

Browse files
Trotttargos
authored andcommitted
tools: simplify commit-queue.sh merge command
The mergeUrl() function is only used in one place. It's a one-liner and inlining it makes the script easier to understand, I think. It also means no future shellcheck complaints about needing to add error handling. PR-URL: #41314 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
1 parent 137c814 commit 9c41247

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tools/actions/commit-queue.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ DEFAULT_BRANCH=master
1212
COMMIT_QUEUE_LABEL="commit-queue"
1313
COMMIT_QUEUE_FAILED_LABEL="commit-queue-failed"
1414

15-
mergeUrl() {
16-
echo "repos/${OWNER}/${REPOSITORY}/pulls/${1}/merge"
17-
}
18-
1915
commit_queue_failed() {
2016
pr=$1
2117

@@ -91,7 +87,7 @@ for pr in "$@"; do
9187
--arg head "$(grep 'Fetched commits as' output | cut -d. -f3 | xargs git rev-parse)" \
9288
'{merge_method:"squash",commit_title:$title,commit_message:$body,sha:$head}' > output.json
9389
cat output.json
94-
if ! gh api -X PUT "$(mergeUrl "$pr")" --input output.json > output; then
90+
if ! gh api -X PUT "repos/${OWNER}/${REPOSITORY}/pulls/${pr}/merge" --input output.json > output; then
9591
commit_queue_failed "$pr"
9692
continue
9793
fi

0 commit comments

Comments
 (0)