Skip to content

Commit fce0446

Browse files
authored
fix!: improve automated quick fix pr generation
1 parent 5194984 commit fce0446

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/fix.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
name: Create Fix PRs
2+
23
on:
34
push:
45
branches: [main]
6+
57
permissions:
68
contents: write
79
pull-requests: write
10+
811
jobs:
912
create-prs:
1013
runs-on: macos-latest
1114
if: contains(github.event.head_commit.message, 'fix!:')
1215
steps:
1316
- uses: actions/checkout@v3
17+
1418
- name: Install latest GitHub CLI
1519
run: |
1620
brew install gh
21+
1722
- name: Create and merge PRs
1823
run: |
19-
PR_NEXT_URL=$(gh pr create --base next --head main --title "chore: apply quick fix from main")
20-
PR_NEXT_NUMBER=$(echo $PR_NEXT_URL | grep -o '[0-9]\+$')
21-
gh pr review $PR_NEXT_NUMBER --approve --body "auto-approved quick fix"
22-
gh pr merge $PR_NEXT_NUMBER --auto --merge
23-
PR_DEV_URL=$(gh pr create --base development --head main --title "chore: apply quick fix from main")
24-
PR_DEV_NUMBER=$(echo $PR_DEV_URL | grep -o '[0-9]\+$')
25-
gh pr review $PR_DEV_NUMBER --approve --body "auto-approved quick fix"
26-
gh pr merge $PR_DEV_NUMBER --auto --merge
24+
PR_NEXT_URL=$(gh pr create --base next --head main --fill)
25+
PR_NEXT_NUMBER=$(echo "$PR_NEXT_URL" | grep -o '[0-9]\+$')
26+
gh pr review "$PR_NEXT_NUMBER" --approve --body "auto-approved quick fix"
27+
gh pr merge "$PR_NEXT_NUMBER" --auto --merge
28+
29+
PR_DEV_URL=$(gh pr create --base development --head main --fill)
30+
PR_DEV_NUMBER=$(echo "$PR_DEV_URL" | grep -o '[0-9]\+$')
31+
gh pr review "$PR_DEV_NUMBER" --approve --body "auto-approved quick fix"
32+
gh pr merge "$PR_DEV_NUMBER" --auto --merge
2733
env:
2834
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)