Skip to content

Commit

Permalink
ci: only run codecov-action if secrets are available
Browse files Browse the repository at this point in the history
Any forked repositories or those without a CODE_COV_TOKEN will attempt
to run the codecov/codecov-action, which will gracefully fail (but waste
time). Instead, we can quickly skip it.
  • Loading branch information
dhensby committed Sep 14, 2023
1 parent a4a44cb commit 04e5199
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -90,6 +91,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -99,6 +101,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -108,6 +111,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -117,6 +121,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -126,6 +131,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -267,6 +273,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -276,6 +283,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -285,6 +293,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -294,6 +303,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -303,6 +313,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -312,6 +323,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -357,6 +369,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -405,6 +418,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -452,6 +466,7 @@ jobs:
run: npx nyc --reporter=lcov npm run test-integration

- uses: codecov/codecov-action@v1
if: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down

0 comments on commit 04e5199

Please sign in to comment.