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

Stop trying to upload the coverage if there is no auth token #220

Merged
merged 1 commit into from
May 5, 2021

Conversation

oliverklee
Copy link
Contributor

This fixes build failures on pull requests from forks (where
usually no authentication token for the code coverage is set).

@oliverklee oliverklee force-pushed the bugfix/no-coverage branch from cce214b to fe2981d Compare May 3, 2021 17:21
@oliverklee oliverklee marked this pull request as draft May 3, 2021 17:21
@oliverklee oliverklee force-pushed the bugfix/no-coverage branch 2 times, most recently from 0b3dfbe to 86b19e4 Compare May 3, 2021 17:27
This fixes build failures on pull requests from forks (where
usually no authentication token for the code coverage is set).

Also fix the name of the coverage upload step to contain the
corect name of the service.
@oliverklee oliverklee force-pushed the bugfix/no-coverage branch from 86b19e4 to 2b23046 Compare May 3, 2021 17:28
@oliverklee oliverklee marked this pull request as ready for review May 3, 2021 17:28
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: "${{ matrix.coverage != 'none' && env.CODACY_PROJECT_TOKEN != '' }}"
Copy link

Choose a reason for hiding this comment

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

This fixes build failures on pull requests from forks...

You could instead check whether the PR is not from a fork:

Suggested change
if: "${{ matrix.coverage != 'none' && env.CODACY_PROJECT_TOKEN != '' }}"
if: github.event.pull_request.head.repo.fork == false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer it this way as this allows forks to still upload coverage to their own coverage server by setting the auth key.

Copy link

Choose a reason for hiding this comment

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

Ah I see. That would include the person also using Codacy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed.

@sabberworm sabberworm merged commit 3e2760c into MyIntervals:master May 5, 2021
@oliverklee oliverklee deleted the bugfix/no-coverage branch May 5, 2021 08:43
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