From 43d21046ec14635c517ae35f9761eda6e712775e Mon Sep 17 00:00:00 2001 From: sahejkm Date: Tue, 21 May 2024 10:47:13 +0800 Subject: [PATCH 1/4] Attempt to fix after approval workflow --- .github/workflows/after-approval.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/after-approval.yml b/.github/workflows/after-approval.yml index 75f494a6388..bfbd147106d 100644 --- a/.github/workflows/after-approval.yml +++ b/.github/workflows/after-approval.yml @@ -3,10 +3,6 @@ name: After Approval on: pull_request_review: types: [submitted] - pull_request_target: - types: [review_requested, opened, reopened, synchronize] - branches: - - 'main' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,11 +10,13 @@ concurrency: jobs: label-pr: - if: github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'extended-tests') + if: github.event.review.state == 'commented' && !contains(github.event.pull_request.labels.*.name, 'extended-tests') runs-on: ubuntu-latest permissions: + contents: read pull-requests: write steps: + - uses: actions/checkout@v4 - name: Add label for extended tests env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -27,6 +25,6 @@ jobs: run: | echo "Adding label 'extended-tests' to PR $NUMBER" gh pr edit "$NUMBER" --add-label "extended-tests" || (echo "Failed to add label" && exit 1) - e2e-tests: - needs: label-pr - uses: ./.github/workflows/call-e2e-all-tests.yml + # e2e-tests: + # needs: label-pr + # uses: ./.github/workflows/call-e2e-all-tests.yml From f57776d0e162251001ee8010ffe531b8c9049873 Mon Sep 17 00:00:00 2001 From: sahejkm Date: Tue, 21 May 2024 11:00:26 +0800 Subject: [PATCH 2/4] . --- .github/workflows/after-approval.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/after-approval.yml b/.github/workflows/after-approval.yml index bfbd147106d..3f6acf63814 100644 --- a/.github/workflows/after-approval.yml +++ b/.github/workflows/after-approval.yml @@ -10,7 +10,7 @@ concurrency: jobs: label-pr: - if: github.event.review.state == 'commented' && !contains(github.event.pull_request.labels.*.name, 'extended-tests') + if: github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'extended-tests') runs-on: ubuntu-latest permissions: contents: read @@ -25,6 +25,6 @@ jobs: run: | echo "Adding label 'extended-tests' to PR $NUMBER" gh pr edit "$NUMBER" --add-label "extended-tests" || (echo "Failed to add label" && exit 1) - # e2e-tests: - # needs: label-pr - # uses: ./.github/workflows/call-e2e-all-tests.yml + e2e-tests: + needs: label-pr + uses: ./.github/workflows/call-e2e-all-tests.yml From 0a0567931652d2a6efd34a41dd1ab28947f2b66f Mon Sep 17 00:00:00 2001 From: sahejkm Date: Thu, 23 May 2024 17:48:41 +0900 Subject: [PATCH 3/4] . --- .github/workflows/after-approval.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/after-approval.yml b/.github/workflows/after-approval.yml index 3f6acf63814..a60e90e0bc2 100644 --- a/.github/workflows/after-approval.yml +++ b/.github/workflows/after-approval.yml @@ -16,10 +16,9 @@ jobs: contents: read pull-requests: write steps: - - uses: actions/checkout@v4 - name: Add label for extended tests env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.ADD_LABEL_PAT }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.pull_request.number }} run: | From ad3e94045d211f961844ed5d043fb711c9fb2af7 Mon Sep 17 00:00:00 2001 From: sahejkm Date: Thu, 23 May 2024 23:42:56 +0900 Subject: [PATCH 4/4] remove e2e tests job as now we are using pat token to add label , git workflow should autotrigger --- .github/workflows/after-approval.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/after-approval.yml b/.github/workflows/after-approval.yml index a60e90e0bc2..61da7e65e17 100644 --- a/.github/workflows/after-approval.yml +++ b/.github/workflows/after-approval.yml @@ -24,6 +24,3 @@ jobs: run: | echo "Adding label 'extended-tests' to PR $NUMBER" gh pr edit "$NUMBER" --add-label "extended-tests" || (echo "Failed to add label" && exit 1) - e2e-tests: - needs: label-pr - uses: ./.github/workflows/call-e2e-all-tests.yml