[Ops] Add github action for auto-approving PRs from kibanamachine (#160641)

## Summary
Adds a GitHub workflow/action for auto-approving backport PRs incoming
from kibanamachine.

These changes are already reviewed by an owner when it was merged to
`main` - afterward the `kibanamachine` creates the PR to the non-main
branches, these can be auto-approved when created, so that the backport
automation is working without assistance.
This commit is contained in:
Alex Szabo 2023-06-28 17:55:30 +02:00 committed by GitHub
parent a64d5823f1
commit d7e8eaa1a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,23 @@
on:
pull_request_target:
branches-ignore:
- main
types:
- opened
env:
NODE_ENV: kibana-github-action
jobs:
approve:
name: Auto-approve backport
runs-on: ubuntu-latest
if: |
contains(github.event.pull_request.labels.*.name, 'backport') &&
github.event.pull_request.user.login == 'kibanamachine'
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v3
with:
github-token: ${{ secrets.KIBANAMACHINE_TOKEN }}