|
5 | 5 | [](https://github.com/codecov/codecov-action/actions/workflows/main.yml) |
6 | 6 | ### Easily upload coverage reports to Codecov from GitHub Actions |
7 | 7 |
|
8 | | -## v4 Beta Release |
9 | | -`v4` of the Codecov GitHub Action will use the [Codecov CLI](https://github.com/codecov/codecov-cli) to upload coverage reports to Codecov. Currently, `v4` is in beta. |
| 8 | +## v4 Release |
| 9 | +`v4` of the Codecov GitHub Action will use the [Codecov CLI](https://github.com/codecov/codecov-cli) to upload coverage reports to Codecov. |
10 | 10 |
|
11 | 11 | Breaking Changes |
12 | 12 | - No current support for `aarch64` and `alpine` architectures. |
13 | | -- Tokenless uploading is unsupported |
| 13 | +- Tokenless uploading is unsupported. However, PRs made from forks to the upstream public repos will support tokenless (e.g. contributors to OS projects do not need the upstream repo's Codecov token) |
14 | 14 | - Various arguments to the Action have been removed |
15 | 15 |
|
16 | | -`v3` versions and below will not have access to CLI features (e.g. global upload token). |
17 | | - |
18 | | -## ⚠️ Deprecation of v1 |
19 | | -**As of February 1, 2022, v1 has been fully sunset and no longer functions** |
20 | | - |
21 | | -Due to the [deprecation](https://about.codecov.io/blog/introducing-codecovs-new-uploader/) of the underlying bash uploader, |
22 | | -the Codecov GitHub Action has released `v2`/`v3` which will use the new [uploader](https://github.com/codecov/uploader). You can learn |
23 | | -more about our deprecation plan and the new uploader on our [blog](https://about.codecov.io/blog/introducing-codecovs-new-uploader/). |
24 | | - |
25 | | -We will be restricting any updates to the `v1` Action to security updates and hotfixes. |
| 16 | +`v3` versions and below will not have access to CLI features (e.g. global upload token, ATS). |
26 | 17 |
|
27 | 18 | ## Usage |
28 | 19 |
|
29 | | -To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v3` is recommended) as a `step` within your `workflow.yml` file. |
| 20 | +To integrate Codecov with your Actions pipeline, specify the name of this repository with a tag number (`@v4` is recommended) as a `step` within your `workflow.yml` file. |
30 | 21 |
|
31 | | -If you have a *private repository*, 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 as a `secret`). Optionally, you can choose to include up to four additional inputs to customize the upload context. **For public repositories, no token is needed** |
| 22 | +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`). |
32 | 23 |
|
33 | 24 | Inside your `.github/workflows/workflow.yml` file: |
34 | 25 |
|
35 | 26 | ```yaml |
36 | 27 | steps: |
37 | 28 | - uses: actions/checkout@master |
38 | | -- uses: codecov/codecov-action@v3 |
| 29 | +- uses: codecov/codecov-action@v4 |
39 | 30 | with: |
40 | | - token: ${{ secrets.CODECOV_TOKEN }} |
41 | 31 | files: ./coverage1.xml,./coverage2.xml # optional |
42 | 32 | flags: unittests # optional |
43 | 33 | name: codecov-umbrella # optional |
44 | 34 | fail_ci_if_error: true # optional (default = false) |
45 | 35 | verbose: true # optional (default = false) |
| 36 | + env: |
| 37 | + token: ${{ secrets.CODECOV_TOKEN }} |
46 | 38 | ``` |
47 | 39 | >**Note**: 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. |
48 | 40 |
|
@@ -118,16 +110,17 @@ jobs: |
118 | 110 | pip install pytest-cov |
119 | 111 | pytest --cov=./ --cov-report=xml |
120 | 112 | - name: Upload coverage to Codecov |
121 | | - uses: codecov/codecov-action@v3 |
| 113 | + uses: codecov/codecov-action@v4 |
122 | 114 | with: |
123 | | - token: ${{ secrets.CODECOV_TOKEN }} |
124 | 115 | directory: ./coverage/reports/ |
125 | 116 | env_vars: OS,PYTHON |
126 | 117 | fail_ci_if_error: true |
127 | 118 | files: ./coverage1.xml,./coverage2.xml,!./cache |
128 | 119 | flags: unittests |
129 | 120 | name: codecov-umbrella |
130 | 121 | verbose: true |
| 122 | + env: |
| 123 | + token: ${{ secrets.CODECOV_TOKEN }} |
131 | 124 | ``` |
132 | 125 | ## Contributing |
133 | 126 |
|
|
0 commit comments