Skip to content

Commit

Permalink
[ci] Use github action to approve API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Jul 1, 2024
1 parent 3ab56f5 commit e6d377c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .buildkite/scripts/common/setup_job_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .buildkite/scripts/steps/api_docs/publish_api_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
18 changes: 18 additions & 0 deletions .github/workflows/auto-approve-api-docs.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions .github/workflows/auto-approve-backports.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
on:
pull_request_target:
pull_request:
branches-ignore:
- main
types:
- opened

jobs:
approve:
Expand All @@ -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

0 comments on commit e6d377c

Please sign in to comment.