From d0370f35f616e3ab4883ea2a6d2c9aef2a5b2edd Mon Sep 17 00:00:00 2001 From: Fritz Lin Date: Mon, 22 Jan 2024 15:18:43 +0800 Subject: [PATCH] Attempt to solve write access as a PR workflow from forks - part 2 https://github.com/marketplace/actions/git-auto-commit#use-in-forks-from-public-repositories https://github.com/stefanzweifel/git-auto-commit-action/issues/211 https://github.com/orgs/community/discussions/26829#discussioncomment-3253580 https://github.com/winglang/wing/issues/5115 https://github.com/pyiron/actions/issues/44 https://github.com/UffizziCloud/preview-action/issues/80 https://github.com/ASFHyP3/hyp3-isce2/issues/179 https://github.com/tveastman/secateur/pull/54 https://github.com/stm32-rs/stm32-rs/pull/949 https://github.com/actions/gh-actions-cache/pull/73 --- .github/workflows/unit-test.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index b192793..da54844 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -40,11 +40,9 @@ jobs: # 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 - )) + github.event.pull_request.head.repo.full_name == github.repository + )) }} uses: we-cli/coverage-badge-action@main