Loading files
988743a91This file is pinned to the selected release. Download the original to open it in your design tool.
---
name: Automerge Release PRs
on:
schedule:
# Run every Monday at 6:00 AM UTC
- cron: '0 6 * * 1'
workflow_dispatch: # Allow manual triggering
permissions: {}
jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v3.1.1
with:
client-id: ${{ secrets.RELEASES_APP_ID }}
private-key: ${{ secrets.RELEASES_APP_PRIVATE_KEY }}
- name: Enable auto-merge for labeled PRs
run: |
set -euo pipefail
prs="$(gh pr list --label automerge --state open --json number --jq '.[].number')"
[[ -z "$prs" ]] && exit 0
while read -r pr; do
gh pr merge --auto --squash "$pr" || true
done <<< "$prs"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_REPO: ${{ github.repository }}