Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9c41247

Browse filesBrowse 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 <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
1 parent 137c814 commit 9c41247
Copy full SHA for 9c41247

File tree

Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed
Open diff view settings
Collapse file

‎tools/actions/commit-queue.sh‎

Copy file name to clipboardExpand all lines: tools/actions/commit-queue.sh
+1-5Lines changed: 1 addition & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.