[ci] Use github action to approve API docs (#187246)

Cleans up our auto-approve scripts a bit to be consistent. This matches
the auto-approve backport workflow.
This commit is contained in:
Jon 2024-07-01 11:23:06 -05:00 committed by GitHub
parent ccfc5d3bb9
commit 581e88ba81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 7 deletions

View file

@ -16,9 +16,6 @@ fi
GITHUB_TOKEN=$(vault_get kibanamachine github_token)
export GITHUB_TOKEN
KIBANA_CI_GITHUB_TOKEN=$(vault_get kibana-ci-github github_token)
export KIBANA_CI_GITHUB_TOKEN
KIBANA_DOCKER_USERNAME="$(vault_get container-registry username)"
KIBANA_DOCKER_PASSWORD="$(vault_get container-registry password)"
if (command -v docker && docker version) &> /dev/null; then

View file

@ -29,5 +29,3 @@ git push origin "$branch"
prUrl=$(gh pr create --repo elastic/kibana --base main --head "$branch" --title "[api-docs] $(date +%F) Daily api_docs build" --body "Generated by $BUILDKITE_BUILD_URL" --label "release_note:skip" --label "docs")
echo "Opened PR: $prUrl"
gh pr merge --repo elastic/kibana --auto --squash "$prUrl"
GH_TOKEN="$KIBANA_CI_GITHUB_TOKEN" gh pr review --repo elastic/kibana --approve -b "Automated review from $BUILDKITE_BUILD_URL" "$prUrl"

View file

@ -0,0 +1,18 @@
on:
pull_request:
branches:
- main
types:
- opened
jobs:
approve:
name: Auto-approve API docs
runs-on: ubuntu-latest
if: |
startsWith(github.event.pull_request.head.ref, 'api_docs') &&
github.event.pull_request.user.login == 'kibanamachine'
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 #4.0.0

View file

@ -1,7 +1,9 @@
on:
pull_request_target:
pull_request:
branches-ignore:
- main
types:
- opened
jobs:
approve:
@ -13,4 +15,4 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v3
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 #4.0.0