Skip to content

Auto merge changes made to the target branches in a pull request #18

Auto merge changes made to the target branches in a pull request

Auto merge changes made to the target branches in a pull request #18

name: Auto merge changes made to the target branches in a pull request
on:
workflow_dispatch:
inputs:
pr_number:
description: Pull request number
required: true
type: string
jobs:
sync-changes:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
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/automerge-action@main
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 ${{ inputs.pr_number }}"
MERGE_FORKS: false
MERGE_RETRIES: 0
MERGE_RETRY_SLEEP: 0
MERGE_REQUIRED_APPROVALS: 0
BASE_BRANCHES: "unstable,experiment"
PULL_REQUEST: ${{ inputs.pr_number }}