Skip to content

Commit

Permalink
ci: add automerge-sync-pr workflow (#48)
Browse files Browse the repository at this point in the history
* ci: add automerge-sync-pr workflow

* ci: use gh app credentials

* ci: add env.BASE_BRANCHES

(cherry picked from commit f84b017)
  • Loading branch information
sumire88 committed Aug 24, 2024
1 parent 40edd48 commit 2817e3e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/automerge-sync-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Auto merge changes made to the target branches in a pull request

on:
pull_request:
types:
- opened

jobs:
sync-changes:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
matrix:
include:
- branch: release
labels: branch/release
fail-fast: false
steps:
- name: Generate GitHub Auth Token
# https://github.com/tibdex/github-app-token
id: generate_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Auto merge changes in the target PR
id: automerge
# https://github.com/pascalgn/automerge-action
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
MERGE_LABELS: "automerge"
MERGE_REMOVE_LABELS: "automerge"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "ci(github-action): auto merge {pullRequest.number}"
MERGE_FORKS: "false"
MERGE_RETRIES: "0"
MERGE_RETRY_SLEEP: "0"
MERGE_REQUIRED_APPROVALS: "0"
BASE_BRANCHES: "unstable,experiment"

0 comments on commit 2817e3e

Please sign in to comment.