mirror of
https://github.com/Sea-Haven-Industries/security-review.git
synced 2026-09-30 04:33:13 +00:00
fix(ci): serialize auto-merge enable and ignore already-enabled
This commit is contained in:
parent
05732978f9
commit
e68661a292
1 changed files with 13 additions and 1 deletions
14
.github/workflows/auto-merge.yaml
vendored
14
.github/workflows/auto-merge.yaml
vendored
|
|
@ -5,6 +5,10 @@ on:
|
||||||
types: [opened, ready_for_review, reopened, synchronize]
|
types: [opened, ready_for_review, reopened, synchronize]
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: enable-auto-merge-${{ github.event.pull_request.number }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
@ -29,4 +33,12 @@ jobs:
|
||||||
echo "auto-merge already enabled"
|
echo "auto-merge already enabled"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
gh pr merge "$PR" --repo "$REPO" --auto
|
if ! out=$(gh pr merge "$PR" --repo "$REPO" --auto 2>&1); then
|
||||||
|
echo "$out"
|
||||||
|
if [ "$(gh pr view "$PR" --repo "$REPO" --json autoMergeRequest --jq '.autoMergeRequest != null')" = "true" ]; then
|
||||||
|
echo "auto-merge already enabled"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
printf '%s\n' "$out"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue