We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d623c2c commit 3ae04c9Copy full SHA for 3ae04c9
2 files changed
tools/actions/commit-queue.sh
@@ -87,22 +87,18 @@ for pr in "$@"; do
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
90
- jq -n \
91
- --arg title "${commit_title}" \
92
- --arg body "${commit_body}" \
93
- --arg head "${commit_head}" \
94
- '{merge_method:"squash",commit_title:$title,commit_message:$body,sha:$head}' > output.json
95
- cat output.json
96
- if ! gh api -X PUT "repos/${OWNER}/${REPOSITORY}/pulls/${pr}/merge" --input output.json > output; then
+ if ! commits="$(
+ jq -cn \
+ --arg title "${commit_title}" \
+ --arg body "${commit_body}" \
+ --arg head "${commit_head}" \
+ '{merge_method:"squash",commit_title:$title,commit_message:$body,sha:$head}' |\
+ gh api -X PUT "repos/${OWNER}/${REPOSITORY}/pulls/${pr}/merge" --input -\
97
+ --jq 'if .merged then .sha else halt_error end'
98
+ )"; then
99
commit_queue_failed "$pr"
100
continue
101
fi
- cat output
- if ! commits="$(jq -r 'if .merged then .sha else error("not merged") end' < output)"; then
102
- commit_queue_failed "$pr"
103
- continue
104
- fi
105
- rm output.json
106
107
108
rm output
tools/actions/merge.sh
@@ -39,24 +39,14 @@ git log -1 HEAD^ --pretty='format:%B' | git interpret-trailers --parse --no-divi
39
commit_title=$(git log -1 --pretty='format:%s')
40
41
42
-jq -n \
+commitSHA="$(
43
44
--arg title "${commit_title}" \
45
--arg body "${commit_body}" \
46
--arg head "${commit_head}" \
47
-cat output.json
48
-if ! gh api -X PUT "repos/${OWNER}/${REPOSITORY}/pulls/${pr}/merge" --input output.json > output; then
49
50
- echo "Failed to merge $pr"
51
- rm output output.json
52
- exit 1
53
-fi
54
-cat output
55
-if ! commits="$(jq -r 'if .merged then .sha else error("not merged") end' < output)"; then
56
57
58
59
60
-rm output.json output
+)"
61
62
-gh pr comment "$pr" --repo "$OWNER/$REPOSITORY" --body "Landed in $commits"
+gh pr comment "$pr" --repo "$OWNER/$REPOSITORY" --body "Landed in $commitSHA"
0 commit comments