| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ad35fe9 commit 4f2c634
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,8 @@ commit_queue_failed() { | |||
| 31 | 31 | git config --local user.email "github-bot@iojs.org" | |
| 32 | 32 | git config --local user.name "Node.js GitHub Bot" | |
| 33 | 33 | ||
| 34 | + SHOULD_ABORT= | ||
| 35 | + | ||
| 34 | 36 | for pr in "$@"; do | |
| 35 | 37 | gh pr view "$pr" --json labels --jq ".labels" > labels.json | |
| 36 | 38 | # Skip PR if CI was requested | |
@@ -56,6 +58,14 @@ for pr in "$@"; do | |||
| 56 | 58 | MULTIPLE_COMMIT_POLICY="--oneCommitMax" | |
| 57 | 59 | fi | |
| 58 | 60 | ||
| 61 | + if [ -n "$SHOULD_ABORT" ]; then | ||
| 62 | + # If `git node land --abort` fails, we're in unknown state. Better to stop | ||
| 63 | + # the script here, current PR was removed from the queue so it shouldn't | ||
| 64 | + # interfere again in the future. | ||
| 65 | + git node land --abort --yes | ||
| 66 | + SHOULD_ABORT= | ||
| 67 | + fi | ||
| 68 | + | ||
| 59 | 69 | git node land --autorebase --yes $MULTIPLE_COMMIT_POLICY "$pr" >output 2>&1 || echo "Failed to land #${pr}" | |
| 60 | 70 | # cat here otherwise we'll be suppressing the output of git node land | |
| 61 | 71 | cat output | |
@@ -64,10 +74,8 @@ for pr in "$@"; do | |||
| 64 | 74 | # if the "Landed in..." message was not on the output we assume land failed | |
| 65 | 75 | if ! grep -q '. Post "Landed in .*/pull/'"${pr}" output; then | |
| 66 | 76 | commit_queue_failed "$pr" | |
| 67 | - # If `git node land --abort` fails, we're in unknown state. Better to stop | ||
| 68 | - # the script here, current PR was removed from the queue so it shouldn't | ||
| 69 | - # interfere again in the future. | ||
| 70 | - git node land --abort --yes | ||
| 77 | + # Using a variable as there's no point in aborting if there are no PRs left in the queue. | ||
| 78 | + SHOULD_ABORT=1 | ||
| 71 | 79 | continue | |
| 72 | 80 | fi | |
| 73 | 81 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments