From 04e51997b45772dc075ee56d4a2af026fe74d929 Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Thu, 14 Sep 2023 22:59:18 +0100 Subject: [PATCH] ci: only run codecov-action if secrets are available 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. --- .github/workflows/nodejs.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 03efeef75..f9d5ac766 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }}