mirror of
https://github.com/Sea-Haven-Industries/payments-dashboard.git
synced 2026-09-30 08:53:12 +00:00
fix(ci): serialize auto-merge enable and ignore already-enabled
This commit is contained in:
parent
a02518b8f5
commit
b78aa22a7a
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]
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: enable-auto-merge-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
|
@ -29,4 +33,12 @@ jobs:
|
|||
echo "auto-merge already enabled"
|
||||
exit 0
|
||||
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