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

Error message "Token required because repository is private" #1602

Open
ruokun-niu opened this issue Oct 8, 2024 · 12 comments
Open

Error message "Token required because repository is private" #1602

ruokun-niu opened this issue Oct 8, 2024 · 12 comments
Assignees
Labels
Area: Tokenless Issues with tokenless bug Something isn't working Medium Medium Priority Issues (to be fixed or re-evaluated in 3 months

Comments

@ruokun-niu
Copy link

Hi Codecov,

I am trying to use the Codecov github actions in my public repo (https://github.com/drasi-project/drasi-core). Specifically, I am testing by creating a PR from a forked branch. However, I ran into the following error

info - 2024-10-08 16:45:46,986 -- The PR is happening in a forked repo. Using tokenless upload.
info - 2024-10-08 16:45:47,254 -- Process Commit creating complete
debug - 2024-10-08 16:45:47,254 -- Commit creating result --- {"result": "RequestResult(error=RequestError(code='HTTP Error 400', params={}, description='{\"message\":\"Token required because repository is private\"}\\n'), warnings=[], status_code=400, text='{\"message\":\"Token required because repository is private\"}\\n')"}
error - 2024-10-08 16:45:47,254 -- Commit creating failed: {"message":"Token required because repository is private"}

My repository was once private when we set codecov up, and we have changed the visibility to public couple weeks ago. Any idea why this is happening?

@BAStos525
Copy link

We have the same issue

@thomasrockhu-codecov
Copy link
Contributor

@ruokun-niu can you try on v5?

@BAStos525 can you post the Codecov output or link to CI?

@mbrock
Copy link

mbrock commented Nov 28, 2024

first time trying codecov, getting this issue consistently on my public repo with v5.0.7

 -> Token of length 0 detected
==> Running create-commit
      ./codecov  create-commit --git-service github
info - 2024-11-28 07:46:35,534 -- ci service found: github-actions
warning - 2024-11-28 07:46:35,542 -- No config file could be found. Ignoring config.
info - 2024-11-28 07:46:35,877 -- Process Commit creating complete
error - 2024-11-28 07:46:35,877 -- Commit creating failed: {"message":"Token required because branch is protected"}
 
==> Running create-report
      ./codecov  create-report --git-service github
info - 2024-11-28 07:46:36,613 -- ci service found: github-actions
warning - 2024-11-28 07:46:36,621 -- No config file could be found. Ignoring config.
info - 2024-11-28 07:46:37,022 -- Process Report creating complete
error - 2024-11-28 07:46:37,022 -- Report creating failed: {"message":"Token required because branch is protected"}
 
==> Running do-upload
      ./codecov  do-upload --gcov-executable gcov --git-service github
info - 2024-11-28 07:46:37,738 -- ci service found: github-actions
warning - 2024-11-28 07:46:37,746 -- No config file could be found. Ignoring config.
warning - 2024-11-28 07:46:37,747 -- xcrun is not installed or can't be found.
warning - 2024-11-28 07:46:37,801 -- No gcov data found.
warning - 2024-11-28 07:46:37,801 -- coverage.py is not installed or can't be found.
info - 2024-11-28 07:46:37,811 -- Found 1 coverage files to report
info - 2024-11-28 07:46:37,811 -- > /home/runner/work/bubble/bubble/coverage.xml
info - 2024-11-28 07:46:38,365 -- Process Upload complete
error - 2024-11-28 07:46:38,365 -- Upload failed: {"message":"Token required because branch is protected"}

it additionally seems strange that it continues after it has already failed, which to me indicates a low quality implementation, and since I need confidence in my code quality tools, I now have no desire to use Codecov

@thomasrockhu-codecov
Copy link
Contributor

@mbrock can you send me a link to CI for this?

@thomasrockhu-codecov
Copy link
Contributor

@ruokun-niu @BAStos525 gentle bumps

@ruokun-niu
Copy link
Author

Hey @thomasrockhu-codecov , sorry for the late update. Somehow I did not receive the notification at first. I'll give this a try today or tomorrow

@ruokun-niu
Copy link
Author

Hi @thomasrockhu-codecov , I attempted to use codecov/codecov-action@v5, but the workflow failed with the following error

error - 2024-12-05 21:49:13,845 -- Upload failed: {"message":"Token required - not valid tokenless upload"}

Link to workflow: https://github.com/drasi-project/drasi-core/actions/runs/12188485129/job/34001570398
link to coverage.yml: https://github.com/drasi-project/drasi-core/blob/codecov-test/.github/workflows/coverage.yaml

This is a branch in a public repository

@ruokun-niu
Copy link
Author

Image
We have also disabled token authentication

@thomasrockhu-codecov
Copy link
Contributor

@ruokun-niu got it, taking a look!

@thomasrockhu-codecov
Copy link
Contributor

@ruokun-niu do you mind running this in verbose mode?

@ruokun-niu
Copy link
Author

@thomasrockhu-codecov
Copy link
Contributor

@ruokun-niu thank you, do you mind re-running again? We made a fix on our side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tokenless Issues with tokenless bug Something isn't working Medium Medium Priority Issues (to be fixed or re-evaluated in 3 months
Projects
None yet
Development

No branches or pull requests

6 participants