Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not upload coverage results to Codecov when run in a fork #496

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

jdblischak
Copy link
Collaborator

When I sync my fork (eg today in jdblischak@98f1234), the test-coverage workflow fails because I don't have CODECOV_TOKEN set.

==> Running command '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-commit'
/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov create-commit --git-service github -Z
info - 2025-01-27 19:45:39,664 -- ci service found: github-actions
warning - 2025-01-27 19:45:[39](https://github.com/jdblischak/gsDesign2/actions/runs/12996942372/job/36246800050#step:6:40),694 -- Branch `main` is protected but no token was provided
warning - 2025-01-27 19:45:39,694 -- For information on Codecov upload tokens, see https://docs.codecov.com/docs/codecov-tokens
info - 2025-01-27 19:45:[40](https://github.com/jdblischak/gsDesign2/actions/runs/12996942372/job/36246800050#step:6:41),169 -- Process Commit creating complete
error - 2025-01-27 19:45:40,169 -- Commit creating failed: {"message":"Token required because branch is protected"}

We only need coverage uploads to Codecov to run on the main repository, so this PR updates the workflow to skip the upload step when running on a fork. However, when running in a PR submitted from a fork, it still performs token-less uploads to Codecov.

xref: #489, Merck/simtrial#307, keaven/gsDesign#179

@jdblischak jdblischak self-assigned this Jan 27, 2025
Copy link
Collaborator

@LittleBeannie LittleBeannie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jdblischak!

@LittleBeannie LittleBeannie merged commit ff9a1d5 into Merck:main Jan 28, 2025
7 checks passed
@jdblischak
Copy link
Collaborator Author

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.

3 participants