Skip to content

Commit fead7fd

Browse files
authored
[skip changelog] Remove unnecessary token input from Codecov upload steps of test workflow (arduino#886)
* Use v1 ref of codecov/codecov-action GitHub Actions action Previously, the workflow pinned the outdated v1.0.2 ref. The requirement for an upload token has been removed since the 1.0.2 release. Removing the token input will provide several benefits: - Prevent failures when the workflow is run in forks, which won't have the CODECOV_TOKEN secret defined. - Allow configuring the workflow to be triggered by pull_request events, making it easy to evaluate the impact the pull request has on code coverage. The use of the v1 ref, rather than pinning a specific version allows the workflow to automatically benefit from ongoing development work on the action, while still preventing it from being affected by breaking changes. * Remove unnecessary token input from Codecov upload steps of test workflow With the modern versions of the codecov/codecov-action GitHub Actions action, the upload token is only required for private repositories. Now that we are using a modern version of the action, this input only has a harmful effect by causing the workflow to fail when run in forks and also preventing us from using Codecov to evaluate the impact on code coverage of pull requests.
1 parent 1b0e6a3 commit fead7fd

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

.github/workflows/test.yaml

+3-18
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,28 @@ jobs:
7777
run: task test-integration
7878

7979
- name: Send unit tests coverage to Codecov
80-
# Since secrets aren't available on forks, we only
81-
# upload coverage on `push`. This might change if
82-
# Codecov whitelists GitHub, lifting the need
83-
# for a token.
8480
if: >
8581
matrix.operating-system == 'ubuntu-latest' &&
8682
github.event_name == 'push'
87-
uses: codecov/codecov-action@v1.0.2
83+
uses: codecov/codecov-action@v1
8884
with:
89-
token: ${{secrets.CODECOV_TOKEN}}
9085
file: ./coverage_unit.txt
9186
flags: unit
9287

9388
- name: Send legacy tests coverage to Codecov
94-
# Since secrets aren't available on forks, we only
95-
# upload coverage on `push`. This might change if
96-
# Codecov whitelists GitHub, lifting the need
97-
# for a token.
9889
if: >
9990
matrix.operating-system == 'ubuntu-latest' &&
10091
github.event_name == 'push'
101-
uses: codecov/codecov-action@v1.0.2
92+
uses: codecov/codecov-action@v1
10293
with:
103-
token: ${{secrets.CODECOV_TOKEN}}
10494
file: ./coverage_legacy.txt
10595
flags: unit
10696

10797
- name: Send integration tests coverage to Codecov
108-
# Since secrets aren't available on forks, we only
109-
# upload coverage on `push`. This might change if
110-
# Codecov whitelists GitHub, lifting the need
111-
# for a token.
11298
if: >
11399
matrix.operating-system == 'ubuntu-latest' &&
114100
github.event_name == 'push'
115-
uses: codecov/codecov-action@v1.0.2
101+
uses: codecov/codecov-action@v1
116102
with:
117-
token: ${{secrets.CODECOV_TOKEN}}
118103
file: ./coverage_integ.txt
119104
flags: integ

0 commit comments

Comments
 (0)