diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ed7c3a75a24e7..6597aed3f3604 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1029,6 +1029,7 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql # Observability robots /.github/workflows/deploy-my-kibana.yml @elastic/observablt-robots +/.github/workflows/undeploy-my-kibana.yml @elastic/observablt-robots /.github/workflows/oblt-github-commands @elastic/observablt-robots # Infra Monitoring diff --git a/.github/workflows/undeploy-my-kibana.yml b/.github/workflows/undeploy-my-kibana.yml new file mode 100644 index 0000000000000..a288702cbb537 --- /dev/null +++ b/.github/workflows/undeploy-my-kibana.yml @@ -0,0 +1,32 @@ +--- +## +## This the automation will undeploy an existing automated deployment +## caused by a merged/closed event and if the GitHub label matches +## the automated one. +## +## Owner: @elastic/observablt-robots +## Further details: https://ela.st/oblt-deploy-my-kibana +## +name: undeploy-my-kibana + +on: + pull_request: + types: [closed] + +permissions: + contents: read + +jobs: + undeploy-my-kibana: + if: contains(github.event.pull_request.labels.*.name, 'ci:project-deploy-observability') + runs-on: ubuntu-latest + steps: + - uses: elastic/apm-pipeline-library/.github/actions/github-token@current + with: + url: ${{ secrets.OBLT_VAULT_ADDR }} + roleId: ${{ secrets.OBLT_VAULT_ROLE_ID }} + secretId: ${{ secrets.OBLT_VAULT_SECRET_ID }} + + - uses: elastic/apm-pipeline-library/.github/actions/undeploy-my-kibana@current + with: + token: ${{ env.GITHUB_TOKEN }}