From e583b6680d8206e61831dfae896fd93968649365 Mon Sep 17 00:00:00 2001 From: Tal-Legit <154063186+Tal-Legit@users.noreply.github.com> Date: Sun, 7 Jul 2024 15:15:53 +0300 Subject: [PATCH] feat: remove label after test (#324) * feat: remove label after test * added colon * give appropriate permissions * changed label synax * return whitespace encoding * moved removal to a new job * added need for the test job * fixed ifs, and added printing for api response * fixed print * added continue on error * remove print * remove continue * added continue on error * remove cont-on-err --- .github/workflows/e2e_testing.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 }} +