From eb61d818171aa5ac76864441dd7c34c58c0d4c28 Mon Sep 17 00:00:00 2001 From: Jixun Wu Date: Wed, 22 Dec 2021 14:10:29 +0000 Subject: [PATCH] fix: avoid "ArtiomTr/jest-coverage-report-action" when running from a fork. (cherry picked from commit 95df64516c59f4bbbffa21625af8f9be13da01af) --- .github/workflows/build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bf5722..1d3bcf9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + name: Test Build on: push: @@ -27,7 +29,14 @@ jobs: steps: - uses: actions/checkout@v2 - run: npm ci - - uses: ArtiomTr/jest-coverage-report-action@v2.0-rc.6 + # note: forks can not access to GITHUB_TOKEN for coverage update. + # instead, we just ran the test in this case. + - name: Test only + if: github.event_name != 'push' + run: npm test + - name: Test + Publish Coverage + uses: ArtiomTr/jest-coverage-report-action@v2.0-rc.6 + if: github.event_name == 'push' with: github-token: ${{ secrets.GITHUB_TOKEN }} annotations: none