Skip to content

Commit ef19810

Browse files
build: don't run steps that req secrets if fork (#359)
* build: don't run steps that req secrets if fork we don't want to run the steps in the CI workflow that require access to secrets so that they don't block the tests from running. * build: build-test-upload doesn' need codecov-startup Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
1 parent be85cc8 commit ef19810

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
3030
codecov-startup:
3131
runs-on: ubuntu-latest
32+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
3233
steps:
3334
- uses: actions/checkout@v4
3435
with:
@@ -50,7 +51,6 @@ jobs:
5051
5152
build-test-upload:
5253
runs-on: ubuntu-latest
53-
needs: codecov-startup
5454
strategy:
5555
fail-fast: false
5656
matrix:
@@ -78,12 +78,14 @@ jobs:
7878
run: |
7979
pytest --cov
8080
- name: Dogfooding codecov-cli
81+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
8182
run: |
8283
codecovcli do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}}
8384
8485
static-analysis:
8586
runs-on: ubuntu-latest
8687
needs: codecov-startup
88+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
8789
steps:
8890
- uses: actions/checkout@v4
8991
with:
@@ -107,6 +109,7 @@ jobs:
107109
label-analysis:
108110
runs-on: ubuntu-latest
109111
needs: static-analysis
112+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
110113
steps:
111114
- uses: actions/checkout@v4
112115
with:

0 commit comments

Comments
 (0)