2023-03-14 16:35:38 +01:00
|
|
|
name: Test & auto merge
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: [ "master" ]
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
uses: ./.github/workflows/test.yaml
|
|
|
|
auto_merge:
|
|
|
|
name: Auto merge
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: tests
|
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
|
|
|
contents: write
|
|
|
|
if: >-
|
|
|
|
github.event.pull_request
|
|
|
|
&& github.event.pull_request.merged == false
|
|
|
|
&& (
|
|
|
|
github.event.pull_request.user.login == 'crocmagnon-pr[bot]'
|
|
|
|
|| github.event.pull_request.user.login == 'pre-commit-ci[bot]'
|
2023-04-22 10:02:51 +02:00
|
|
|
|| github.event.pull_request.user.login == 'dependabot[bot]'
|
2023-03-14 16:35:38 +01:00
|
|
|
)
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-11 13:58:41 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-04-22 10:02:51 +02:00
|
|
|
- name: Generate token
|
2023-09-11 13:58:35 +02:00
|
|
|
uses: tibdex/github-app-token@v2
|
2023-04-22 10:02:51 +02:00
|
|
|
id: generate-token
|
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.PR_APP_ID }}
|
|
|
|
private_key: ${{ secrets.PR_APP_PRIVATE_KEY }}
|
2023-03-14 16:35:38 +01:00
|
|
|
- name: Auto merge
|
2023-04-22 10:02:51 +02:00
|
|
|
run: GITHUB_TOKEN=${{ steps.generate-token.outputs.token }} gh pr merge ${{github.event.pull_request.number}} --delete-branch --rebase
|