File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,24 @@ jobs:
194194 - name : Merge all code coverage artifacts
195195 run : gocovmerge coverage*.txt > coverage.txt
196196
197+ # A token is used to avoid intermittent spurious job failures caused by rate limiting.
198+ - name : Set up Codecov upload token
199+ run : |
200+ if [[ "${{ github.repository }}" == "arduino/arduino-cli" ]]; then
201+ # In order to avoid uploads of data from forks, only use the token for runs in the arduino/arduino-ide repo.
202+ # Token is intentionally exposed.
203+ # See: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
204+ CODECOV_TOKEN="18b9885b-cbf2-4166-bfbb-39617323daf0"
205+ else
206+ # codecov/codecov-action does unauthenticated upload if empty string is passed via the `token` input.
207+ CODECOV_TOKEN=""
208+ fi
209+ echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> "$GITHUB_ENV"
210+
197211 - name : Send unit tests coverage to Codecov
198212 uses : codecov/codecov-action@v3
199213 with :
214+ token : ${{ env.CODECOV_TOKEN }}
200215 files : ./coverage.txt
201216 flags : unit
202217 fail_ci_if_error : ${{ github.repository == 'arduino/arduino-cli' }}
You can’t perform that action at this time.
0 commit comments