File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -194,10 +194,24 @@ jobs:
194
194
- name : Merge all code coverage artifacts
195
195
run : gocovmerge coverage*.txt > coverage.txt
196
196
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
+
197
211
- name : Send unit tests coverage to Codecov
198
212
uses : codecov/codecov-action@v3
199
213
with :
200
- token : ${{ secrets .CODECOV_TOKEN }}
214
+ token : ${{ env .CODECOV_TOKEN }}
201
215
files : ./coverage.txt
202
216
flags : unit
203
217
fail_ci_if_error : ${{ github.repository == 'arduino/arduino-cli' }}
You can’t perform that action at this time.
0 commit comments