diff --git a/.github/workflows/e2e_testing.yaml b/.github/workflows/e2e_testing.yaml index abf0bd00..f5721f00 100644 --- a/.github/workflows/e2e_testing.yaml +++ b/.github/workflows/e2e_testing.yaml @@ -10,6 +10,7 @@ on: types: [ labeled ] permissions: contents: read + pull-requests: write jobs: install_and_run_e2e_tests: if: ${{ github.event.pull_request.head.repo.fork == false || (github.event.pull_request.head.repo.fork == true && contains(github.event.pull_request.labels.*.name,'Approve E2E Test')) }} @@ -93,3 +94,15 @@ jobs: SLACK_COLOR: ${{ job.status }} SLACK_MESSAGE: E2E Tests failed - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} SLACK_TITLE: "Legitify periodic E2E test failed" + + remove_e2e_label: + if: ${{ always() && (github.event.pull_request.head.repo.fork == true && contains(github.event.pull_request.labels.*.name,'Approve E2E Test')) }} + needs: install_and_run_e2e_tests + runs-on: ubuntu-latest + steps: + - name: Remove E2E Label + run: | + gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/${{ 'Approve%20E2E%20Test' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} +