Skip to content

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/unit-test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,14 @@ jobs:
3737
run: npm run test:cov
3838

3939
- name: Update Coverage Badge
40-
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.node-version == 18 }}
40+
# Is there a way to tell if a PR is from a forked repository? #26829
41+
# https://github.com/orgs/community/discussions/26829#discussioncomment-3253580
42+
if: >-
43+
matrix.os == 'ubuntu-22.04' && matrix.node-version == 18 && ((
44+
github.event_name == 'pull_request' &&
45+
github.event.pull_request.head.repo.full_name == github.repository
46+
) || (
47+
github.event_name == 'pull_request_target' &&
48+
github.event.pull_request.head.repo.full_name != github.repository
49+
))
4150
uses: we-cli/coverage-badge-action@main

0 commit comments

Comments
 (0)