Skip to content

Upload failed: {"message":"Token required because branch is protected"} #1709

@hugovk

Description

@hugovk

https://github.com/python-humanize/humanize is a public repo which at https://app.codecov.io/account/gh/prettytable/org-upload-token has "Token authentication": "Not required".

Image

However, with codecov/codecov-action@v5.0.7, uploads fail because "Token required because branch is protected":

I have no variables or secrets defined with tokens, and I'd rather not have to do it for each org and each repo in my personal account.

Details
Run codecov/codecov-action@v5.0.7
  with:
    flags: ubuntu-latest
    name: ubuntu-latest Python 3.13
    disable_file_fixes: false
    disable_search: false
    disable_safe_directory: false
    dry_run: false
    fail_ci_if_error: false
    git_service: github
    gcov_executable: gcov
    handle_no_reports_found: false
    skip_validation: false
    use_legacy_upload_endpoint: false
    use_oidc: false
    verbose: false
    version: latest
  env:
    FORCE_COLOR: 1
    pythonLocation: /opt/hostedtoolcache/Python/3.13.0/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.0/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.0/x64
    Python[2](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:3).13.0/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.0/x6[4](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:4)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.0/x64/lib
    UV_CACHE_DIR: /tmp/scu-uv-cache
    HASH_CACHE_SUFFIX: -[5](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:5)53f8ec07c5d31c32b518222af119d02c18e50f2[6](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:6)d526d19df4b0ee9d4b7035e
    DATE_CACHE_SUFFIX: -48
Run CC_ACTION_VERSION=$(cat ${GITHUB_ACTION_PATH}/src/version | grep 'CODECOV_ACTION_VERSION=' | cut -d\" -f2)
==> Running Action version 5.0.[7](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:7)
Run git config --global --add safe.directory /home/runner/work/humanize/humanize
    CC_SWIFT_PROJECT: 
    CC_VERBOSE: false
    CC_VERSION: latest
    CC_YML_PATH: 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
                            Wrapper-0.0.27
                                  
==> Detected linux
 -> Downloading https://cli.codecov.io/latest/linux/codecov
==> Finishing downloading linux:latest
parse error: Invalid numeric literal at line 1, column 10
      Version: 
 
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key [8](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:8)06BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1
==> Verifying GPG signature integrity
 -> Downloading https://cli.codecov.io/latest/linux/codecov.SHA256SUM
 -> Downloading https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
 
gpg: Signature made Fri Nov 15 18:5[9](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:9):14 2024 UTC
gpg:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpg: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 2703 4E7F DB85 0E0B BC2C  62FF 806B B28A ED77 9869
codecov: OK
==> CLI integrity verified
 -> Token of length 0 detected
==> Running create-commit
      ./codecov  create-commit --git-service github --sha fd2d2c25d3944bf6f19f3971c6ef63b4789b656c
info - 2024-12-01 13:19:55,696 -- ci service found: github-actions
warning - 2024-12-01 13:19:55,705 -- No config file could be found. Ignoring config.
info - 2024-12-01 13:19:56,067 -- Process Commit creating complete
error - 2024-12-01 13:19:56,067 -- Commit creating failed: {"message":"Token required because branch is protected"}
 
==> Running create-report
      ./codecov  create-report --git-service github --sha fd2d2c25d3944bf6f19f3971c6ef63b4789b656c
info - 2024-12-01 13:19:56,788 -- ci service found: github-actions
warning - 2024-12-01 13:19:56,797 -- No config file could be found. Ignoring config.
info - 2024-12-01 13:19:57,147 -- Process Report creating complete
error - 2024-12-01 13:19:57,147 -- Report creating failed: {"message":"Token required because branch is protected"}
 
==> Running do-upload
      ./codecov  do-upload --flag ubuntu-latest --gcov-executable gcov --git-service github --name ubuntu-latest Python 3.13 --sha fd2d2c25d3944bf6f19f3971c6ef63b4789b656c
info - 2024-12-01 13:19:57,868 -- ci service found: github-actions
warning - 2024-12-01 13:19:57,877 -- No config file could be found. Ignoring config.
warning - 2024-12-01 13:19:57,878 -- xcrun is not installed or can't be found.
warning - 2024-12-01 13:19:57,898 -- No gcov data found.
warning - 2024-12-01 13:19:57,898 -- coverage.py is not installed or can't be found.
info - 2024-12-01 13:19:57,9[10](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:10) -- Found 1 coverage files to report
info - 2024-[12](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:12)-01 13:19:57,910 -- > /home/runner/work/humanize/humanize/coverage.xml
info - 2024-12-01 [13](https://github.com/python-humanize/humanize/actions/runs/12100961377/job/33750869342?pr=220#step:9:13):19:58,307 -- Process Upload complete
error - 2024-12-01 13:19:58,307 -- Upload failed: {"message":"Token required because branch is protected"}

Metadata

Metadata

Labels

highHigh Priority Issues (to be fixed within 2 sprints)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions