Skip to content

Conversation

@hduelme
Copy link
Contributor

@hduelme hduelme commented Dec 26, 2025

Codecov now requires a token for coverage uploads by default. This causes GitHub workflows from contributors to fail, for example: https://github.com/hduelme/mapstruct-idea/actions/runs/20526826353/job/58971584684

Codecov Action v5 introduces support for tokenless uploads. To enable this, a repository setting must be changed in Codecov. See https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token

For more details about the v5 migration, see: https://github.com/codecov/codecov-action?tab=readme-ov-file#migration-guide

@filiphr
Copy link
Member

filiphr commented Dec 28, 2025

Thanks for your analysis on this @hduelme. I've updated the setting, so now it should work.

Nevertheless, don't you think that it would make sense to disable the coverage upload from forks?

@filiphr filiphr merged commit b078ff2 into mapstruct:main Dec 28, 2025
8 checks passed
@hduelme
Copy link
Contributor Author

hduelme commented Dec 28, 2025

@filiphr The GitHub Actions in contributors repositories are still failing on coverage upload: https://github.com/hduelme/mapstruct-idea/actions/runs/20554191598/job/59036022262.
From my perspective, there is no major downside to allowing coverage uploads from forks, but also no significant benefit. For me, the main advantage would be being able to verify that build itself doesn't fail, without having to check the failed step each time.
At the moment, I’m not sure whether we can conditionally disable the upload based on if the repository is a fork. We could remove the fail_ci_if_error flag, but that would also weaken the current check that ensures coverage is uploaded successfully on the main repository.

If you want I could have a look at our options for the GitHub Actions.

@filiphr
Copy link
Member

filiphr commented Dec 28, 2025

That's weird @hduelme. The configuration looks like:

image

At the moment, I’m not sure whether we can conditionally disable the upload based on if the repository is a fork.

Yes we can do this. If we add something like:

if: github.repository_owner == 'mapstruct'

in the "Upload coverage to Codecov" step then the step will not run in forks.

We do something similar for publishing snapshots in core MapStruct

https://github.com/mapstruct/mapstruct/blob/4e1720c2a899252de448c38eb10942f9fbbf5276/.github/workflows/main.yml#L35

@hduelme
Copy link
Contributor Author

hduelme commented Dec 28, 2025

@filiphr I opened a new PR, where I change the workflow to skip the upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants