You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/codecov/codecov-action/actions/workflows/main.yml)
6
+
6
7
### Easily upload coverage reports to Codecov from GitHub Actions
7
8
8
9
## v5 Release
10
+
9
11
`v5` of the Codecov GitHub Action will use the [Codecov Wrapper](https://github.com/codecov/wrapper) to encapsulate the [CLI](https://github.com/codecov/codecov-cli). This will help ensure that the Action gets updates quicker.
10
12
11
13
### Migration Guide
14
+
12
15
The `v5` release also coincides with the opt-out feature for tokens for public repositories. In the `Global Upload Token` section of the settings page of an organization in codecov.io, you can set the ability for Codecov to receive a coverage reports from any source. This will allow contributors or other members of a repository to upload without needing access to the Codecov token. For more details see [how to upload without a token](https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token).
13
16
14
-
> [!WARNING]
15
-
>**The following arguments have been changed**
17
+
> [!WARNING] > **The following arguments have been changed**
18
+
>
16
19
> -`file` (this has been deprecated in favor of `files`)
17
20
> -`plugin` (this has been deprecated in favor of `plugins`)
18
21
@@ -30,13 +33,16 @@ The following arguments have been added:
30
33
You can see their usage in the `action.yml`[file](https://github.com/codecov/codecov-action/blob/main/action.yml).
31
34
32
35
## v4 Release
36
+
33
37
`v4` of the Codecov GitHub Action will use the [Codecov CLI](https://github.com/codecov/codecov-cli) to upload coverage reports to Codecov.
34
38
35
39
### Breaking Changes
40
+
36
41
- Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OSS projects do not need the upstream repo's Codecov token). For details, [see our docs](https://docs.codecov.com/docs/codecov-uploader#supporting-token-less-uploads-for-forks-of-open-source-repos-using-codecov)
37
42
- Various arguments to the Action have been removed
38
43
39
44
### Dependabot
45
+
40
46
- For repositories using `Dependabot`, users will need to ensure that it has access to the Codecov token for PRs from Dependabot to upload coverage. To do this, please add your `CODECOV_TOKEN` as a Dependabot Secret. For more information, see ["Configuring access to private registries for Dependabot."](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/configuring-access-to-private-registries-for-dependabot#storing-credentials-for-dependabot-to-use)
41
47
42
48
`v3` versions and below will not have access to CLI features (e.g. global upload token, ATS).
@@ -51,6 +57,7 @@ To integrate Codecov with your Actions pipeline, specify the name of this reposi
51
57
This Action also requires you to [provide an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) from [codecov.io](https://www.codecov.io) (tip: in order to avoid exposing your token, [store it](https://docs.codecov.com/docs/adding-the-codecov-token#github-actions) as a `secret`).
52
58
53
59
Currently, the Action will identify linux, macos, and windows runners. However, the Action may misidentify other architectures. The OS can be specified as
60
+
54
61
- alpine
55
62
- alpine-arm64
56
63
- linux
@@ -62,37 +69,39 @@ Inside your `.github/workflows/workflow.yml` file:
> This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are *not* available to forks of repositories.
100
+
> This assumes that you've set your Codecov token inside _Settings > Secrets_ as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are _not_ available to forks of repositories.
93
101
94
102
### Using OIDC
95
-
For users with [OpenID Connect(OIDC) enabled](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect), the Codecov token is not necessary. You can use OIDC with the `use_oidc` argument as following.
103
+
104
+
As an alternative to Codecov upload tokens, you can choose to use OIDC as your upload authentication method by setting the `use_oidc` argument:
96
105
97
106
```yaml
98
107
- uses: codecov/codecov-action@v5
@@ -102,6 +111,16 @@ For users with [OpenID Connect(OIDC) enabled](https://docs.github.com/en/actions
102
111
103
112
Any token supplied will be ignored, as Codecov will default to the OIDC token for verification.
104
113
114
+
Note that the codecov action must have write permission for `id-token` for this to work:
115
+
116
+
```yaml
117
+
permissions:
118
+
id-token: write
119
+
```
120
+
121
+
This can be set at either the workflow or job level. See GitHub's [docs](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-
122
+
openid-connect) for more details.
123
+
105
124
## Arguments
106
125
107
126
Codecov's Action supports inputs from the user. These inputs, along with their descriptions and usage contexts, are listed in the table below:
@@ -171,30 +190,31 @@ jobs:
171
190
os: [ubuntu-latest, macos-latest, windows-latest]
172
191
env:
173
192
OS: ${{ matrix.os }}
174
-
PYTHON: '3.10'
193
+
PYTHON: "3.10"
175
194
steps:
176
-
- uses: actions/checkout@main
177
-
- name: Setup Python
178
-
uses: actions/setup-python@main
179
-
with:
180
-
python-version: '3.10'
181
-
- name: Generate coverage report
182
-
run: |
183
-
pip install pytest
184
-
pip install pytest-cov
185
-
pytest --cov=./ --cov-report=xml
186
-
- name: Upload coverage to Codecov
187
-
uses: codecov/codecov-action@v5
188
-
with:
189
-
directory: ./coverage/reports/
190
-
env_vars: OS,PYTHON
191
-
fail_ci_if_error: true
192
-
files: ./coverage1.xml,./coverage2.xml,!./cache
193
-
flags: unittests
194
-
name: codecov-umbrella
195
-
token: ${{ secrets.CODECOV_TOKEN }}
196
-
verbose: true
195
+
- uses: actions/checkout@main
196
+
- name: Setup Python
197
+
uses: actions/setup-python@main
198
+
with:
199
+
python-version: "3.10"
200
+
- name: Generate coverage report
201
+
run: |
202
+
pip install pytest
203
+
pip install pytest-cov
204
+
pytest --cov=./ --cov-report=xml
205
+
- name: Upload coverage to Codecov
206
+
uses: codecov/codecov-action@v5
207
+
with:
208
+
directory: ./coverage/reports/
209
+
env_vars: OS,PYTHON
210
+
fail_ci_if_error: true
211
+
files: ./coverage1.xml,./coverage2.xml,!./cache
212
+
flags: unittests
213
+
name: codecov-umbrella
214
+
token: ${{ secrets.CODECOV_TOKEN }}
215
+
verbose: true
197
216
```
217
+
198
218
## Contributing
199
219
200
220
Contributions are welcome! Check out the [Contribution Guide](CONTRIBUTING.md).
0 commit comments