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

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Ops] Add github action for auto-approving PRs from kibanamachine
(#160641)](https://github.com/elastic/kibana/pull/160641)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2023-06-28T15:55:30Z","message":"[Ops]
Add github action for auto-approving PRs from kibanamachine
(#160641)\n\n## Summary\r\nAdds a GitHub workflow/action for
auto-approving backport PRs incoming\r\nfrom kibanamachine.\r\n\r\nThese
changes are already reviewed by an owner when it was merged to\r\n`main`
- afterward the `kibanamachine` creates the PR to the
non-main\r\nbranches, these can be auto-approved when created, so that
the backport\r\nautomation is working without
assistance.","sha":"d7e8eaa1a254a0df9b920fa0e398eae2e48c0479","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:all-open","v8.10.0"],"number":160641,"url":"https://github.com/elastic/kibana/pull/160641","mergeCommit":{"message":"[Ops]
Add github action for auto-approving PRs from kibanamachine
(#160641)\n\n## Summary\r\nAdds a GitHub workflow/action for
auto-approving backport PRs incoming\r\nfrom kibanamachine.\r\n\r\nThese
changes are already reviewed by an owner when it was merged to\r\n`main`
- afterward the `kibanamachine` creates the PR to the
non-main\r\nbranches, these can be auto-approved when created, so that
the backport\r\nautomation is working without
assistance.","sha":"d7e8eaa1a254a0df9b920fa0e398eae2e48c0479"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160641","number":160641,"mergeCommit":{"message":"[Ops]
Add github action for auto-approving PRs from kibanamachine
(#160641)\n\n## Summary\r\nAdds a GitHub workflow/action for
auto-approving backport PRs incoming\r\nfrom kibanamachine.\r\n\r\nThese
changes are already reviewed by an owner when it was merged to\r\n`main`
- afterward the `kibanamachine` creates the PR to the
non-main\r\nbranches, these can be auto-approved when created, so that
the backport\r\nautomation is working without
assistance.","sha":"d7e8eaa1a254a0df9b920fa0e398eae2e48c0479"}}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
This commit is contained in:
Kibana Machine 2023-06-28 13:03:57 -04:00 committed by GitHub
parent 6808ead622
commit 2892b240e1
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 }}