From e96dd19a3c41f77c86a01ae27de465d96e9bd770 Mon Sep 17 00:00:00 2001 From: Fritz Lin Date: Mon, 22 Jan 2024 15:18:43 +0800 Subject: [PATCH] CI Debug --- .github/workflows/unit-test.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index b192793..b4fe70b 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -36,15 +36,25 @@ jobs: - name: Test run: npm run test:cov + - name: Debug + run: | + echo "matrix.os: ${{ matrix.os }}" + echo "matrix.node-version: ${{ matrix.node-version }}" + echo "github.event_name: ${{ github.event_name }}" + echo "github.event.pull_request.base.repo.name: ${{ github.event.pull_request.base.repo.name }}" + echo "github.event.pull_request.base.repo.full_name: ${{ github.event.pull_request.base.repo.full_name }}" + echo "github.event.pull_request.head.repo.full_name: ${{ github.event.pull_request.head.repo.full_name }}" + echo "github.repository: ${{ github.repository }}" + echo "github.event.pull_request.head.repo.fork: ${{ github.event.pull_request.head.repo.fork }}" - name: Update Coverage Badge # Is there a way to tell if a PR is from a forked repository? #26829 # https://github.com/orgs/community/discussions/26829#discussioncomment-3253580 if: >- - matrix.os == 'ubuntu-22.04' && matrix.node-version == 18 && (( - github.event_name == 'pull_request' && - github.event.pull_request.head.repo.full_name == github.repository + ${{ matrix.os == 'ubuntu-22.04' && matrix.node-version == 18 && (( + github.event_name != 'pull_request' ) || ( - github.event_name == 'pull_request_target' && - github.event.pull_request.head.repo.full_name != github.repository - )) - uses: we-cli/coverage-badge-action@main + github.event.pull_request.head.repo.full_name == github.repository + )) }} + # uses: we-cli/coverage-badge-action@main + run: | + echo "Triggered Coverage Badge"