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

Add token instructions to codecov-action #16

Merged
merged 10 commits into from
Mar 1, 2024

Conversation

fmauch
Copy link
Contributor

@fmauch fmauch commented Feb 22, 2024

Since 4v this is required. For this to work, adding a CODECOV_TOKEN action secret needs to be added to the GH repository.

This should fix our problems on uploading the code coverage as discussed in ros-controls/control_toolbox#188. Closes #15

In the target repo a secret has to be added in the project settings:
**
image
**

The token can be extracted on codecov.io.

Since 4v this is required. For this to work, adding a `CODECOV_TOKEN` action secret needs to be added to the GH repository.
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

I already had this, but it didn't work out well.
I tested the secrets: inherit option from the calling workflow from control_toolbox repository, but inside my fork I didn't have the token specified obviously. how does this work from our repos as well as from forks?

@christophfroehlich
Copy link
Contributor

btw: you can test this with a calling workflow, where you specifiy your repo for the reusable workflow.

This seems required for reusable workflows
@fmauch
Copy link
Contributor Author

fmauch commented Feb 22, 2024

I'll play around with that...

@fmauch fmauch marked this pull request as draft February 22, 2024 19:27
Comment on lines 14 to 16
secrets:
CODECOV_TOKEN:
required: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this is not required if we use secrets: inherit?

Note: If the secrets are inherited by using secrets: inherit in the calling workflow, you can reference them even if they are not explicitly defined in the on key.

https://docs.github.com/en/actions/using-workflows/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow

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 am not sure whether this is then also unnecessary on the reusable workflow. I'm currently merely testing things, hence the draft state. I'm having the impression that things aren't sorted out with codecov's v4 action, though. With this version I'm having different trouble Commit creating failed: ["Service not found: none"] which seems to pop up in codecov/feedback#263. There seems to be a workaround, but I expect that runs us into codecov/codecov-action#1287. There seems to be work around this, e.g. codecov/codecov-action@f62c5ee.

We might consider going back to v3 until things are sorted out?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggested the same in the comment below ;)

@christophfroehlich
Copy link
Contributor

it seems that v4 has lots of issues, and similar reported errors
codecov/codecov-action#1292
should we downgrade it to v4 until it get certainly fixed upstream?

@fmauch fmauch marked this pull request as ready for review February 28, 2024 20:27
@christophfroehlich
Copy link
Contributor

Let's check if this works also from forks: fmauch/control_toolbox#1
I configured the other repos with secrets: inherit, I'm not sure where the advantages are..

@fmauch
Copy link
Contributor Author

fmauch commented Feb 29, 2024

Let's check if this works also from forks: fmauch/control_toolbox#1 I configured the other repos with secrets: inherit, I'm not sure where the advantages are..

https://github.com/fmauch/control_toolbox/actions/runs/8095478742/attempts/1: "Secret CODECOV_TOKEN is required, but not provided while calling."

I can update this PR to not requiring it as an input and see whether inheriting works.

If we can simply use `inherit: true` in the calling workflow that would be nice.
@fmauch
Copy link
Contributor Author

fmauch commented Feb 29, 2024

@christophfroehlich
Copy link
Contributor

Great:

info - 2024-02-29 12:01:35,886 -- The PR is happening in a forked repo. Using tokenless upload.

You changed now my PR for ros-controls/control_toolbox. but let's merge this one first. We always can revert it ;)

@fmauch
Copy link
Contributor Author

fmauch commented Feb 29, 2024

You changed now my PR for ros-controls/control_toolbox. but let's merge this one first. We always can revert it ;)

Ah sorry, I didn't realize you were using the same branch. for creating the PR at my fork.

Regarding the inherit vs. explicitly passing in the secret: When passing in the secret explicitly, the workflow could potentially be reused outside of the ros-controls organization. But for the moment I would also be fine with doing it that way.

Co-authored-by: Felix Exner (fexner) <git@fexner.de>
@christophfroehlich christophfroehlich merged commit 83e9649 into ros-controls:master Mar 1, 2024
1 check passed
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.

Fix codecov token
2 participants