Skip to content

Commit

Permalink
Us event_name based condiiton for codecov actions
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Waltlova <[email protected]>
  • Loading branch information
andywaltlova committed Oct 22, 2024
1 parent 8cd73f4 commit 124d68f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ jobs:
run: pdm run python -m pytest tests/unit --cov=ols --cov=runner --cov-report xml

- name: Upload coverage reports to Codecov with GitHub Action (with token = main repo)
if: github.repository == 'road-core/service'
if: |
github.event_name == 'push' && github.repository == 'road-core/service' ||
github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'road-core/service'
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage reports to Codecov with GitHub Action (without token = forks)
if: github.repository != 'road-core/service'
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'road-core/service'
uses: codecov/[email protected]

0 comments on commit 124d68f

Please sign in to comment.