-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Include codecov on GitHub Actions #6421
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
Conversation
Hmmm indeed, It seems currently there's no easy way either to accomplish this with GitHub actions: https://github.community/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/td-p/30678 Any hints on how to proceed? Seems having coverage only on the main repository kind of defeats the purpose. cc @asottile @blueyed @bluetech @Zac-HD @RonnyPfannschmidt @hugovk |
if you're exposing the value to forks it's not really a secret at that point (someone could might as well put it inline 🤷♂ |
If you put it inline, builds on forks (even if no PR is made) will be sent to the pytest's own Codecov, which clutters up the logs somewhat, and fork users cannot see their own coverage before creating PRs. We - name: Prepare coverage token
if: success() && github.repository == 'python-pillow/Pillow'
run: cp .github/codecov-upstream.yml .codecov.yml
- name: Upload coverage
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
If you do want GHA coverage from your own fork's builds sent to your own fork's Codecov, fetch your token from https://codecov.io/gh/my-username/pytest/settings and add it as |
Here are the Codecov and GitHub Actions issues to follow: |
So are we all in agreement that even on Travis and Azure the current token is not really a secret, because malicious forks can push code to eventually read them somehow? If so, I suggest we follow @hugovk's suggestion to avoid having forks uploading coverage by default. |
I've pushed a commit that enables the entire matrix with full coverage, so we can see how long it takes in practice. |
Hmm but won't the build fail in case someone doesn't define |
No, it shouldn't fail, it just won't upload any coverage. Here's a recent PR from a new contributor to Pillow who (most likely) doesn't have any token set in their fork:
Confirmation of no reports on their Codecov: I do have my own token defined in my fork:
The corresponding coverage report on my own Codecov: |
Oh sure my bad, there's an option in the coverage action to fail the build or not. 😅 Wow seems like all builds took less than 8m or so (except for |
Codecov does not need a token on Travis. |
Yep:
So Azure Pipelines and GitHub Actions are currently in the same boat. Hynek Schlawack's "Python in Azure Pipelines, Step by Step":
|
That's my understanding too. I would like an explicit yes from people before proceeding to commit the token to the repository, like it is done on python-pillow/Pillow#4266. To my understanding this is OK, but once done it is technically out there (although I'm sure we can revoke the token somehow if this turns out to be a bad decision). |
send it! |
Yes from me too! If necessary, the token can be regenerated (and presumably revoked) at https://codecov.io/gh/pytest-dev/pytest/settings |
This overwrites the `codecov.yml` file in the root of the repository with `codecov-upstream.yml` file (which contains the code-cov token)´, so PRs and branches on the repository can upload coverage. Suggestion from here: #6421 (comment) Security concerns: the token might be misused, but only to upload bogus coverage to `codecov.io`, so the team believe this is harmless. If we decide to fallback from this decision , we just need to revoke the token. Related to #6369
fc455bc
to
d660537
Compare
This overwrites the `codecov.yml` file in the root of the repository with `codecov-upstream.yml` file (which contains the code-cov token)´, so PRs and branches on the repository can upload coverage. Suggestion from here: #6421 (comment) Security concerns: the token might be misused, but only to upload bogus coverage to `codecov.io`, so the team believe this is harmless. If we decide to fallback from this decision , we just need to revoke the token. Related to #6369
f5ea935
to
0c80a8b
Compare
This overwrites the `codecov.yml` file in the root of the repository with `codecov-upstream.yml` file (which contains the code-cov token)´, so PRs and branches on the repository can upload coverage. Suggestion from here: #6421 (comment) Security concerns: the token might be misused, but only to upload bogus coverage to `codecov.io`, so the team believe this is harmless. If we decide to fallback from this decision , we just need to revoke the token. Related to #6369
c34d17c
to
205252d
Compare
This overwrites the `codecov.yml` file in the root of the repository with `codecov-upstream.yml` file (which contains the code-cov token)´, so PRs and branches on the repository can upload coverage. Suggestion from here: #6421 (comment) Security concerns: the token might be misused, but only to upload bogus coverage to `codecov.io`, so the team believe this is harmless. If we decide to fallback from this decision , we just need to revoke the token. Related to #6369
205252d
to
49fbd9f
Compare
This overwrites the `codecov.yml` file in the root of the repository with `codecov-upstream.yml` file (which contains the code-cov token)´, so PRs and branches on the repository can upload coverage. Suggestion from here: #6421 (comment) Security concerns: the token might be misused, but only to upload bogus coverage to `codecov.io`, so the team believe this is harmless. If we decide to fallback from this decision , we just need to revoke the token. Related to #6369
96f7618
to
30ec04b
Compare
This overwrites the `codecov.yml` file in the root of the repository with `codecov-upstream.yml` file (which contains the code-cov token)´, so PRs and branches on the repository can upload coverage. Suggestion from here: pytest-dev#6421 (comment) Security concerns: the token might be misused, but only to upload bogus coverage to `codecov.io`, so the team believe this is harmless. If we decide to fallback from this decision , we just need to revoke the token. Related to pytest-dev#6369
Closed this in favor of #6441 (on my fork). |
Follow up from #6420