Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: simplify commit-queue.sh merge command #41314

Merged
merged 1 commit into from Dec 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions tools/actions/commit-queue.sh
Expand Up @@ -12,10 +12,6 @@ DEFAULT_BRANCH=master
COMMIT_QUEUE_LABEL="commit-queue"
COMMIT_QUEUE_FAILED_LABEL="commit-queue-failed"

mergeUrl() {
echo "repos/${OWNER}/${REPOSITORY}/pulls/${1}/merge"
}

commit_queue_failed() {
pr=$1

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