Skip to content

Commit

Permalink
feat: remove label after test (#324)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Tal-Legit authored Jul 7, 2024
1 parent d37f390 commit e583b66
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/e2e_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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')) }}
Expand Down Expand Up @@ -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 }}

0 comments on commit e583b66

Please sign in to comment.