Skip to content

Commit 015e235

Browse files
authored
Stop CI from uploading Codecov results when a PR comes from a fork. (#3917)
Also fix the condition used on the Enterprise tests.
1 parent 188c636 commit 015e235

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-cobertura.xml
6161
6262
- name: Upload coverage to Codecov
63+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} # Skip in forks
6364
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
6465
with:
6566
fail_ci_if_error: true
@@ -73,7 +74,7 @@ jobs:
7374
xcresultparser -q -o junit -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-junit.xml
7475
7576
- name: Upload test results to Codecov
76-
if: ${{ !cancelled() }}
77+
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
7778
uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 #v1.1.0
7879
continue-on-error: true
7980
with:

.github/workflows/unit_tests_enterprise.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: macos-15
1515

1616
# Skip in forks
17-
if: github.repository == 'element-hq/element-x-ios'
17+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
1818

1919
concurrency:
2020
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.

0 commit comments

Comments
 (0)