Skip to content

Commit

Permalink
add automerge functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
alldoami committed Nov 29, 2023
1 parent 291af22 commit 5877c93
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:

# Step 12: Merge prod branch into main
- name: Merge prod into main
id: createpr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: peter-evans/create-pull-request@v4
Expand All @@ -99,6 +100,24 @@ jobs:
title: 'chore: merge prod into main'
base: main
branch: prod
labels: automerge

# Step 13: Automerge PR
- name: Enable Automerge PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.createpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.createpr.outputs.pull-request-number }}
merge-method: squash

# Step 14: Autoapprove PR
- name: Autoapprove PR
if: steps.createpr.outputs.pull-request-operation == 'created'
run: gh pr review --approve "${{ steps.createpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Job 2
create-version-matrix:
Expand Down

0 comments on commit 5877c93

Please sign in to comment.