fix(NA): checking pr author through github.head_ref instead of pull_request event on auto backport approve ghaction (#160807)

The action is getting skipped on backports and I suspect we were not
checking correctly for the pr author. I changed it a little to make sure
we are getting the pr author through the head ref so we can validate is
being created by kibanamachine.
This commit is contained in:
Tiago Costa 2023-06-28 20:56:11 +01:00 committed by GitHub
parent fd1bad1f66
commit c7b2d2be8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,16 +5,13 @@ on:
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'
contains(github.head_ref, 'kibanamachine:backport')
permissions:
pull-requests: write
steps: