Skip to content

Commit c5d60d7

Browse files
chore: use codecov token for CI test runs internally (#1757)
## PR Checklist - [x] Addresses an existing open issue: fixes #1756 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Adds the `env:` addition internally. Doesn't add it to created repos, because I think most consumers aren't going to be hitting the Codecov 429 rate limits very often. I don't want them to have to add a _third_ new token to their repos. 💖
1 parent 85c53e7 commit c5d60d7

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ jobs:
6565
- uses: actions/checkout@v4
6666
- uses: ./.github/actions/prepare
6767
- run: pnpm run test --coverage
68-
- if: always()
68+
- env:
69+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
70+
if: always()
6971
uses: codecov/codecov-action@v3
7072
with:
7173
flags: unit
@@ -77,7 +79,9 @@ jobs:
7779
- uses: ./.github/actions/prepare
7880
- run: pnpm run build
7981
- run: pnpm run test:create
80-
- if: always()
82+
- env:
83+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
84+
if: always()
8185
uses: codecov/codecov-action@v3
8286
with:
8387
files: coverage-create/lcov.info
@@ -90,7 +94,9 @@ jobs:
9094
- uses: ./.github/actions/prepare
9195
- run: pnpm run build
9296
- run: pnpm run test:initialize
93-
- if: always()
97+
- env:
98+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
99+
if: always()
94100
uses: codecov/codecov-action@v3
95101
with:
96102
files: coverage-initialize/lcov.info
@@ -103,7 +109,9 @@ jobs:
103109
- uses: ./.github/actions/prepare
104110
- run: pnpm run build
105111
- run: pnpm run test:migrate
106-
- if: always()
112+
- env:
113+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
114+
if: always()
107115
uses: codecov/codecov-action@v3
108116
with:
109117
files: coverage-migrate/lcov.info

script/__snapshots__/migrate-test-e2e.ts.snap

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ exports[`expected file changes > .github/workflows/ci.yml 1`] = `
3030
name: Build
3131
runs-on: ubuntu-latest
3232
@@ ... @@ jobs:
33+
- uses: actions/checkout@v4
34+
- uses: ./.github/actions/prepare
3335
- run: pnpm run test --coverage
34-
- if: always()
35-
uses: codecov/codecov-action@v3
36+
- - env:
37+
- CODECOV_TOKEN: \${{ secrets.CODECOV_TOKEN }}
38+
- if: always()
39+
- uses: codecov/codecov-action@v3
3640
- with:
3741
- flags: unit
3842
- test_creation_script:
@@ -43,7 +47,9 @@ exports[`expected file changes > .github/workflows/ci.yml 1`] = `
4347
- - uses: ./.github/actions/prepare
4448
- - run: pnpm run build
4549
- - run: pnpm run test:create
46-
- - if: always()
50+
- - env:
51+
- CODECOV_TOKEN: \${{ secrets.CODECOV_TOKEN }}
52+
- if: always()
4753
- uses: codecov/codecov-action@v3
4854
- with:
4955
- files: coverage-create/lcov.info
@@ -56,7 +62,9 @@ exports[`expected file changes > .github/workflows/ci.yml 1`] = `
5662
- - uses: ./.github/actions/prepare
5763
- - run: pnpm run build
5864
- - run: pnpm run test:initialize
59-
- - if: always()
65+
- - env:
66+
- CODECOV_TOKEN: \${{ secrets.CODECOV_TOKEN }}
67+
- if: always()
6068
- uses: codecov/codecov-action@v3
6169
- with:
6270
- files: coverage-initialize/lcov.info
@@ -69,8 +77,11 @@ exports[`expected file changes > .github/workflows/ci.yml 1`] = `
6977
- - uses: ./.github/actions/prepare
7078
- - run: pnpm run build
7179
- - run: pnpm run test:migrate
72-
- - if: always()
73-
- uses: codecov/codecov-action@v3
80+
- - env:
81+
- CODECOV_TOKEN: \${{ secrets.CODECOV_TOKEN }}
82+
- if: always()
83+
+ - if: always()
84+
uses: codecov/codecov-action@v3
7485
- with:
7586
- files: coverage-migrate/lcov.info
7687
- flags: migrate

0 commit comments

Comments
 (0)