spiegel-keyman/.github/workflows/auto-merge-keyman-server-pr.yml
Marc Durdin eb1babfee1 maint(resources): auto merge on branch name rather than label
In order to avoid a race condition where label can be added after the
GHA starts, we will check the branch name instead of `automerge` label.

Fixes: #15027
Test-bot: skip
Build-bot: skip
2025-10-31 17:31:49 +01:00

29 lines
1.1 KiB
YAML

#
# Automatically merges pull requests opened by keyman-server The initial use of
# this action is to increment the patch version of Keyman with
# resources/teamcity/triggers/trigger-release-builds.sh. That script creates a PR and
# then this workflow will be triggered to approve the PR (from github-actions
# account), and then automerge it.
#
name: Auto Merge PRs from keyman-server
on:
pull_request:
types: [opened]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.repository == 'keymanapp/keyman' && github.actor == 'keyman-server' && startsWith(github.head_ref, 'auto/') }}
steps:
- name: auto approve PR from keyman-server
shell: bash
env:
GH_TOKEN: "${{ github.token }}"
run: |
gh pr review -R keymanapp/keyman --approve ${{ github.event.pull_request.number }}
- name: mark PR for auto-merge from keyman-server
shell: bash
env:
GH_TOKEN: "${{ secrets.AUTOINC_GITHUB_TOKEN }}"
run: |
gh pr merge -R keymanapp/keyman --merge --auto ${{ github.event.pull_request.number }}