From b614f25d203fd064f75abe092cf3937884fbdb16 Mon Sep 17 00:00:00 2001 From: ypoplavs <45286051+ypoplavs@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:23:54 +0300 Subject: [PATCH] add sandbox deletion (#5674) --- .github/workflows/sandbox-deletion.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/sandbox-deletion.yaml diff --git a/.github/workflows/sandbox-deletion.yaml b/.github/workflows/sandbox-deletion.yaml new file mode 100644 index 00000000000..a17e5eabf71 --- /dev/null +++ b/.github/workflows/sandbox-deletion.yaml @@ -0,0 +1,25 @@ +name: Remove sandbox environment + +on: + pull_request: + types: [closed] + +jobs: + delete: + if: startsWith(github.event.pull_request.head.ref, 'sandbox/') + runs-on: ubuntu-latest + steps: + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - name: Repository dispatch + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ steps.app-token.outputs.token }} + repository: kubeshop/testkube-deployment + event-type: sandbox_env_delete + client-payload: '{"ref_name": "${{ github.event.pull_request.head.ref }}"}'