Skip to content

Commit a55df0d

Browse files
authored
[skip changelog] Enable Codecov comments on PRs from forks (#1819)
Versions of the `codecov/codecov-action` GitHub Actions action prior to 1.0.6 required the use of a token provided by Codecov in order to upload data to Codecov. This token was stored in secret in the Arduino CLI repository and used in the test workflow. For security reasons, secrets are not accessible when a workflow is triggered by an event generated by a fork of the repository. This meant that it was impossible to upload coverage data for the test runs triggered by PRs from forks. A conditional was added to the upload step of the workflow to cause it to only run on `push` event triggers, which effectively prevented its failure for runs on PRs from forks. The token requirement was removed in the 1.0.6 release of `codecov/codecov-action`, but the now pointless conditional was never removed from the workflow. This prevented PRs from forks from receiving the automated code coverage report comments that would otherwise encourage those contributors to resolve coverage deficiencies and facilitate the review process. The harmful conditional is hereby removed from the coverage data upload steps of the workflow and PRs from forks will now receive coverage report comments, just as PRs from branches do already.
1 parent 5332ffd commit a55df0d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: .github/workflows/test-go-task.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,15 @@ jobs:
9898
run: task test-legacy
9999

100100
- name: Send unit tests coverage to Codecov
101-
if: >
102-
runner.os == 'Linux' &&
103-
github.event_name == 'push'
101+
if: runner.os == 'Linux'
104102
uses: codecov/codecov-action@v3
105103
with:
106104
file: ./coverage_unit.txt
107105
flags: unit
108106
fail_ci_if_error: ${{ github.repository == 'arduino/arduino-cli' }}
109107

110108
- name: Send legacy tests coverage to Codecov
111-
if: >
112-
runner.os == 'Linux' &&
113-
github.event_name == 'push'
109+
if: runner.os == 'Linux'
114110
uses: codecov/codecov-action@v3
115111
with:
116112
file: ./coverage_legacy.txt

0 commit comments

Comments
 (0)