Stop CI from uploading Codecov results when a PR comes from a fork. (#3917)
Also fix the condition used on the Enterprise tests.
This commit is contained in:
3
.github/workflows/unit_tests.yml
vendored
3
.github/workflows/unit_tests.yml
vendored
@@ -60,6 +60,7 @@ jobs:
|
||||
xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-cobertura.xml
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} # Skip in forks
|
||||
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
@@ -73,7 +74,7 @@ jobs:
|
||||
xcresultparser -q -o junit -p $(pwd) fastlane/test_output/PreviewTests.xcresult > fastlane/test_output/preview-junit.xml
|
||||
|
||||
- name: Upload test results to Codecov
|
||||
if: ${{ !cancelled() }}
|
||||
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
|
||||
uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 #v1.1.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
|
||||
2
.github/workflows/unit_tests_enterprise.yml
vendored
2
.github/workflows/unit_tests_enterprise.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: macos-15
|
||||
|
||||
# Skip in forks
|
||||
if: github.repository == 'element-hq/element-x-ios'
|
||||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
|
||||
|
||||
concurrency:
|
||||
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
|
||||
|
||||
Reference in New Issue
Block a user