Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/auto-approve-and-merge-keyman-server-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@
# Automatically approves and queues for merge any pull requests with a branch
# name starting with auto/, that are opened by keyman-server.
#


name: Auto Approve and Merge PRs from keyman-server

on: pull_request_target
on: pull_request

jobs:
auto-approve:
if: github.actor == 'keyman-server' && startsWith(github.head_ref, 'auto/')
# This test is here for safety, to prevent us accidentally approving and
# merging pull requests which don't meet our automatic merge requirements.
#
# Important: this test does not provide security; security is provided by
# GitHub as secrets are not available to forks. A PR from a fork can delete
# this test and the action will run, but without a valid GH_TOKEN it won't
# succeed.
Comment on lines +13 to +19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 helpful!

if: github.event.pull_request.head.repo.owner.login == 'keymanapp' && github.actor == 'keyman-server' && startsWith(github.head_ref, 'auto/')
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.AUTO_PR_APPROVAL_BY_KEYMAN_STATUS }}
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
sparse-checkout: |
README.md
sparse-checkout-cone-mode: false
- name: Approve pull request
run: |
gh pr review --approve ${{github.head_ref}}
gh pr review --repo ${{github.repository}} --approve ${{github.event.pull_request.number}}
- name: Enable auto-merge
run: |
gh pr merge --merge --auto ${{github.head_ref}}
gh pr merge --repo ${{github.repository}} --merge --auto ${{github.event.pull_request.number}}