From 91d379d31935f6330d2e2444452d80e162e12cc2 Mon Sep 17 00:00:00 2001 From: khanhtranduy <130121475+khanhtranduy@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:45:43 +0700 Subject: [PATCH] skip test report from fork PR --- .github/workflow-template.yaml | 4 +++- .github/workflows/cart-ci.yaml | 4 +++- .github/workflows/customer-ci.yaml | 4 +++- .github/workflows/inventory-ci.yaml | 4 +++- .github/workflows/location-ci.yaml | 4 +++- .github/workflows/media-ci.yaml | 4 +++- .github/workflows/order-ci.yaml | 4 +++- .github/workflows/payment-ci.yaml | 4 +++- .github/workflows/payment-paypal-ci.yaml | 4 +++- .github/workflows/product-ci.yaml | 4 +++- .github/workflows/promotion-ci.yaml | 4 +++- .github/workflows/rating-ci.yaml | 4 +++- .github/workflows/search-ci.yaml | 4 +++- .github/workflows/tax-ci.yaml | 4 +++- 14 files changed, 42 insertions(+), 14 deletions(-) diff --git a/.github/workflow-template.yaml b/.github/workflow-template.yaml index dbc20165d4..bb1b771aae 100644 --- a/.github/workflow-template.yaml +++ b/.github/workflow-template.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f {{SERVICE_NAME}} - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Unit-Test-Results path: "{{SERVICE_NAME}}/**/surefire-reports/*.xml" diff --git a/.github/workflows/cart-ci.yaml b/.github/workflows/cart-ci.yaml index 975977ae95..848710c9a4 100644 --- a/.github/workflows/cart-ci.yaml +++ b/.github/workflows/cart-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -pl cart -am - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Cart-Service-Unit-Test-Results path: "cart/**/surefire-reports/*.xml" diff --git a/.github/workflows/customer-ci.yaml b/.github/workflows/customer-ci.yaml index ae0b76ec82..2ef7b2e570 100644 --- a/.github/workflows/customer-ci.yaml +++ b/.github/workflows/customer-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f customer - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Customer-Service-Unit-Test-Results path: "customer/**/surefire-reports/*.xml" diff --git a/.github/workflows/inventory-ci.yaml b/.github/workflows/inventory-ci.yaml index b44f125816..2e0e904de4 100644 --- a/.github/workflows/inventory-ci.yaml +++ b/.github/workflows/inventory-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f inventory - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Inventory-Service-Unit-Test-Results path: "inventory/**/surefire-reports/*.xml" diff --git a/.github/workflows/location-ci.yaml b/.github/workflows/location-ci.yaml index 8a96953c94..04c932c1de 100644 --- a/.github/workflows/location-ci.yaml +++ b/.github/workflows/location-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f location - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Location-Service-Unit-Test-Results path: "location/**/surefire-reports/*.xml" diff --git a/.github/workflows/media-ci.yaml b/.github/workflows/media-ci.yaml index bab0480b0d..6225e9e784 100644 --- a/.github/workflows/media-ci.yaml +++ b/.github/workflows/media-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f media - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Media-Service-Unit-Test-Results path: "media/**/surefire-reports/*.xml" diff --git a/.github/workflows/order-ci.yaml b/.github/workflows/order-ci.yaml index 8fccdc5955..522a061a18 100644 --- a/.github/workflows/order-ci.yaml +++ b/.github/workflows/order-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -pl order -am - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Order-Service-Unit-Test-Results path: "order/**/surefire-reports/*.xml" diff --git a/.github/workflows/payment-ci.yaml b/.github/workflows/payment-ci.yaml index f96c4e221f..d316bbbc48 100644 --- a/.github/workflows/payment-ci.yaml +++ b/.github/workflows/payment-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -pl payment -am - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Payment-Service-Unit-Test-Results path: "payment/**/surefire-reports/*.xml" diff --git a/.github/workflows/payment-paypal-ci.yaml b/.github/workflows/payment-paypal-ci.yaml index e3267fd391..d5dae65156 100644 --- a/.github/workflows/payment-paypal-ci.yaml +++ b/.github/workflows/payment-paypal-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f payment-paypal - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Payment-Paypal-Unit-Test-Results path: "payment-paypal/**/surefire-reports/*.xml" diff --git a/.github/workflows/product-ci.yaml b/.github/workflows/product-ci.yaml index 5effa8b920..c12c0f83ec 100644 --- a/.github/workflows/product-ci.yaml +++ b/.github/workflows/product-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -pl product -am - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Product-Service-Unit-Test-Results path: "product/**/surefire-reports/*.xml" diff --git a/.github/workflows/promotion-ci.yaml b/.github/workflows/promotion-ci.yaml index 3b420ee414..5eaee1d8a9 100644 --- a/.github/workflows/promotion-ci.yaml +++ b/.github/workflows/promotion-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f promotion - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Promotion-Service-Unit-Test-Results path: "promotion/**/surefire-reports/*.xml" diff --git a/.github/workflows/rating-ci.yaml b/.github/workflows/rating-ci.yaml index 38dabfe0e2..33358669bb 100644 --- a/.github/workflows/rating-ci.yaml +++ b/.github/workflows/rating-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f rating - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Rating-Service-Unit-Test-Results path: "rating/**/surefire-reports/*.xml" diff --git a/.github/workflows/search-ci.yaml b/.github/workflows/search-ci.yaml index 86c4c92961..ec29f10b0c 100644 --- a/.github/workflows/search-ci.yaml +++ b/.github/workflows/search-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f search - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Search-Service-Unit-Test-Results path: "search/**/surefire-reports/*.xml" diff --git a/.github/workflows/tax-ci.yaml b/.github/workflows/tax-ci.yaml index bc521335e1..36c21f3e9e 100644 --- a/.github/workflows/tax-ci.yaml +++ b/.github/workflows/tax-ci.yaml @@ -30,7 +30,9 @@ jobs: run: mvn test -f tax - name: Unit Test Results uses: dorny/test-reporter@v1 - if: success() || failure() + if: | + ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} && + (success() || failure()) with: name: Tax-Service-Unit-Test-Results path: "tax/**/surefire-reports/*.xml"