Skip to content

Commit b0d2072

Browse files
projectgusdpgeorge
authored andcommitted
github: Ignore codecov upload failure on forks with no token set.
If you enable Actions on your fork of MicroPython then it consistently fails the Coverage Upload step (unless you set a codecov token in your fork). This means you get a failure email each time you push to your own repo. This commit fixes that. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent da0149f commit b0d2072

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/ports_unix.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ jobs:
9595
- name: Upload coverage to Codecov
9696
uses: codecov/codecov-action@v5
9797
with:
98-
fail_ci_if_error: true
98+
# Only fail the job on error if a token is set, or we're running against upstream repo.
99+
# This avoids the annoying situation of the job failing on every push to a fork (if no token is set).
100+
fail_ci_if_error: ${{ secrets.CODECOV_TOKEN != '' || github.repository_owner == 'micropython' }}
99101
verbose: true
102+
# note: when a fork opens a PR into MicroPython repo, the pull_request trigger can't access
103+
# secrets so this token value will be empty (codecov will do a 'tokenless' upload).
100104
token: ${{ secrets.CODECOV_TOKEN }}
101105
- name: Print failures
102106
if: failure()

0 commit comments

Comments
 (0)