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

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

Closed
hugovk opened this issue Dec 1, 2024 · 9 comments
Closed
Assignees
Labels
high High Priority Issues (to be fixed within 2 sprints)

Comments

@hugovk
Copy link

hugovk commented Dec 1, 2024

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"}
@stumpylog

This comment has been minimized.

@thomasrockhu-codecov
Copy link
Contributor

@hugovk I'm digging into this, would it be possible to turn verbose: true?

@H0R5E
Copy link

H0R5E commented Dec 6, 2024

This is happening to me as well on https://github.com/DTOcean/dtocean. Here's my output with verbose: true. I'm running the actions on the next branch, FYI.

The log output
Run codecov/codecov-action@v5
  with:
    flags: aneris
    verbose: true
    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
    version: latest
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.13.1/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python[2](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:3).13.1/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x6[4](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:4)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib
Run CC_ACTION_VERSION=$(cat ${GITHUB_ACTION_PATH}/src/version | grep 'CODECOV_ACTION_VERSION=' | cut -d\" -f2)
  CC_ACTION_VERSION=$(cat ${GITHUB_ACTION_PATH}/src/version | grep 'CODECOV_ACTION_VERSION=' | cut -d\" -f2)
  echo -e "\033[0;32m==>\033[0m Running Action version $CC_ACTION_VERSION"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.13.1/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib
==> Running Action version [5](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:5).1.1
Run git config --global --add safe.directory /home/runner/work/dtocean/dtocean
  git config --global --add safe.directory /home/runner/work/dtocean/dtocean
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.13.1/x[6](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:6)4
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib
Run if [ "false" == 'true' ];
  if [ "false" == 'true' ];
  then
    # {"count":1984,"value":"***"}
    CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://codecov.io" | cut -d\" -f6)
    echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
  elif [ -n "" ];
  then
      echo "CC_TOKEN=" >> "$GITHUB_ENV"
  else
    if [ -n  ];
    then
      CC_TOKEN=$(echo  | tr -d '\n')
      echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
    fi
  fi
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.13.1/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib
Run if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ -n "$GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME" ] && [ "${GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME}" != "$GITHUB_REPOSITORY" ];
  if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ -n "$GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME" ] && [ "${GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME}" != "$GITHUB_REPOSITORY" ];
  then
    echo -e "\033[0;32m==>\033[0m Fork detected, tokenless uploading used"
    TOKENLESS="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"
    CC_BRANCH="$GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL"
    echo "TOKENLESS=$TOKENLESS" >> "$GITHUB_ENV"
  fi
  
  echo "CC_BRANCH=$CC_BRANCH" >> "$GITHUB_ENV"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.13.1/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib
    CC_TOKEN: 
    CC_BRANCH: 
    GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL: 
    GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FULL_NAME: 
    GITHUB_REPOSITORY: DTOcean/dtocean
Run if [ -z "$CC_SHA" ];
  if [ -z "$CC_SHA" ];
  then
    CC_SHA="$GITHUB_EVENT_PULL_REQUEST_HEAD_SHA"
  fi
  if [ -z "$CC_PR" ] && [ "${GITHUB_EVENT_NAME}" == "pull_request_target" ];
  then
    CC_PR="$GITHUB_EVENT_NUMBER"
  fi
  
  echo "CC_SHA=$CC_SHA" >> "$GITHUB_ENV"
  echo "CC_PR=$CC_PR" >> "$GITHUB_ENV"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.13.1/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib
    CC_TOKEN: 
    CC_BRANCH: 
    CC_PR: 
    CC_SHA: 
    GITHUB_EVENT_NAME: push
    GITHUB_EVENT_NUMBER: 
    GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: 
Run ${GITHUB_ACTION_PATH}/dist/codecov.sh
  ${GITHUB_ACTION_PATH}/dist/codecov.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.13.1/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.13.1/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.13.1/x64/lib
    CC_TOKEN: 
    CC_BRANCH: 
    CC_SHA: 
    CC_PR: 
    CC_BINARY: 
    CC_BUILD: 
    CC_BUILD_URL: 
    CC_CODE: 
    CC_DIR: 
    CC_DISABLE_FILE_FIXES: false
    CC_DISABLE_SEARCH: false
    CC_DRY_RUN: false
    CC_ENTERPRISE_URL: 
    CC_ENV: 
    CC_EXCLUDES: 
    CC_FAIL_ON_ERROR: false
    CC_FILES: 
    CC_FLAGS: aneris
    CC_GCOV_ARGS: 
    CC_GCOV_EXECUTABLE: gcov
    CC_GCOV_IGNORE: 
    CC_GCOV_INCLUDE: 
    CC_GIT_SERVICE: github
    CC_HANDLE_NO_REPORTS_FOUND: false
    CC_JOB_CODE: 
    CC_LEGACY: false
    CC_NAME: 
    CC_NETWORK_FILTER: 
    CC_NETWORK_PREFIX: 
    CC_NETWORK_ROOT_FOLDER: 
    CC_OS: 
    CC_PARENT_SHA: 
    CC_PLUGINS: 
    CC_REPORT_TYPE: 
    CC_SKIP_VALIDATION: false
    CC_SLUG: 
    CC_SWIFT_PROJECT: 
    CC_VERBOSE: true
    CC_VERSION: latest
    CC_YML_PATH: 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
                            Wrapper-0.0.30
                                  
==> Detected linux
 -> Downloading https://cli.codecov.io/latest/linux/codecov
==> Finishing downloading linux:latest
      Version: v9.1.0
 
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED[7](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:7)79869: 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 Thu Dec  5 20:49:23 2024 UTC
gpg:                using RSA key 27034E7FDB[8](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:8)50E0BBC2C62FF806BB28AED77[9](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:9)869
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 upload-coverage
      ./codecov --verbose upload-coverage --git-service github --flag aneris --gcov-executable gcov
info - 2024-12-06 12:[11](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:11):04,856 -- ci service found: github-actions
debug - 2024-[12](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:12)-06 12:11:04,859 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-12-06 12:11:04,861 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
warning - 2024-12-06 12:11:04,864 -- No config file could be found. Ignoring config.
debug - 2024-12-06 12:11:04,864 -- No codecov_yaml found
debug - 2024-12-06 12:11:04,866 -- Starting upload coverage --- {"verbose": true, "auto_load_params_from": null, "codecov_yml_path": null, "enterprise_url": null, "version": "cli-9.1.0", "command": "upload-coverage", "git_service": "github", "flags": ["aneris"], "gcov_executable": "gcov", "commit_sha": "d6055[14](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:14)02d127b29cd26126ff2a7de8bd8f72dbe", "fail_on_error": false, "slug": "DTOcean/dtocean", "report_code": "default", "network_root_folder": "/home/runner/work/dtocean/dtocean", "files_search_root_folder": "/home/runner/work/dtocean/dtocean", "files_search_exclude_folders": [], "files_search_explicitly_listed_files": [], "disable_search": false, "disable_file_fixes": false, "build_code": "12[19](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:19)8548520", "build_url": "https://github.com/DTOcean/dtocean/actions/runs/121985485[20](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:20)", "job_code": "Aneris Unit Tests", "name": "12198548520", "branch": "next", "pull_request_number": null, "env_vars": {}, "plugin_names": ["xcode", "gcov", "pycoverage"], "dry_run": false, "use_legacy_uploader": false, "handle_no_reports_found": false, "report_type": "coverage", "network_filter": null, "network_prefix": null, "gcov_args": null, "gcov_ignore": null, "gcov_include": null, "swift_project": null, "parent_sha": null}
debug - 2024-12-06 12:11:04,866 -- Selected preparation plugins --- {"selected_plugins": ["<class 'codecov_cli.plugins.xcode.XcodePlugin'>", "<class 'codecov_cli.plugins.gcov.GcovPlugin'>", "<class 'codecov_cli.plugins.pycoverage.Pycoverage'>"], "cli_config": {}}
debug - 2024-12-06 12:11:04,866 -- Running preparation plugin: <class 'codecov_cli.plugins.xcode.XcodePlugin'>
debug - 2024-12-06 12:11:04,866 -- Running xcode plugin...
warning - 2024-12-06 12:11:04,866 -- xcrun is not installed or can't be found.
debug - 2024-12-06 12:11:04,866 -- Running preparation plugin: <class 'codecov_cli.plugins.gcov.GcovPlugin'>
debug - 2024-12-06 12:11:04,866 -- Running gcov plugin...
warning - 2024-12-06 12:11:04,870 -- No gcov data found.
debug - 2024-12-06 12:11:04,870 -- Running preparation plugin: <class 'codecov_cli.plugins.pycoverage.Pycoverage'>
warning - 2024-12-06 12:11:04,871 -- coverage.py is not installed or can't be found.
debug - 2024-12-06 12:11:04,871 -- Collecting relevant files
info - 2024-12-06 12:11:04,881 -- Found 1 coverage files to report
info - 2024-12-06 12:11:04,881 -- > /home/runner/work/dtocean/dtocean/packages/aneris/coverage.xml
debug - 2024-12-06 12:11:04,884 -- Selected uploader to use: <class 'codecov_cli.services.upload.upload_sender.UploadSender'>
debug - 2024-12-06 12:11:04,887 -- Sending upload request to Codecov
info - 2024-12-06 12:11:05,[23](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:23)8 -- Process Upload complete
debug - 2024-12-06 12:11:05,238 -- Upload result --- {"result": "RequestResult(error=RequestError(code='HTTP Error 400', params={}, description='{\"message\":\"Token required because branch is protected\"}\\n'), warnings=[], status_code=400, text='{\"message\":\"Token required because branch is protected\"}\\n')"}
error - 20[24](https://github.com/DTOcean/dtocean/actions/runs/12198548520/job/34030535067#step:7:25)-12-06 12:11:05,238 -- Upload failed: {"message":"Token required because branch is protected"}

@hugovk
Copy link
Author

hugovk commented Dec 6, 2024

@hugovk I'm digging into this, would it be possible to turn verbose: true?

Turned on:

https://github.com/python-humanize/humanize/actions/runs/12199990414?pr=220

info - 2024-12-06 13:53:58,840 -- ci service found: github-actions
debug - 2024-12-06 13:53:58,843 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-12-06 13:53:58,846 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
warning - 2024-12-06 13:53:58,849 -- No config file could be found. Ignoring config.
debug - 2024-12-06 13:53:58,849 -- No codecov_yaml found
debug - 2024-12-06 13:53:58,850 -- Starting upload coverage --- {"verbose": true, "auto_load_params_from": null, "codecov_yml_path": null, "enterprise_url": null, "version": "cli-9.1.0", "command": "upload-coverage", "git_service": "github", "commit_sha": "dc445a7e6a786701c2dedaf02742f57e643ff06d", "flags": ["ubuntu-latest"], "gcov_executable": "gcov", "name": "ubuntu-latest Python 3.13", "fail_on_error": false, "slug": "python-humanize/humanize", "report_code": "default", "network_root_folder": "/home/runner/work/humanize/humanize", "files_search_root_folder": "/home/runner/work/humanize/humanize", "files_search_exclude_folders": [], "files_search_explicitly_listed_files": [], "disable_search": false, "disable_file_fixes": false, "build_code": "12199990414", "build_url": "https://github.com/python-humanize/humanize/actions/runs/12199990414", "job_code": "Test", "branch": "renovate/github-actions", "pull_request_number": "220", "env_vars": {}, "plugin_names": ["xcode", "gcov", "pycoverage"], "dry_run": false,
debug - 2024-12-06 13:53:58,850 -- Selected preparation plugins --- {"selected_plugins": ["<class 'codecov_cli.plugins.xcode.XcodePlugin'>", "<class 'codecov_cli.plugins.gcov.GcovPlugin'>", "<class 'codecov_cli.plugins.pycoverage.Pycoverage'>"], "cli_config": {}}
debug - 2024-12-06 13:53:58,851 -- Running preparation plugin: <class 'codecov_cli.plugins.xcode.XcodePlugin'>
debug - 2024-12-06 13:53:58,851 -- Running xcode plugin...
warning - 2024-12-06 13:53:58,851 -- xcrun is not installed or can't be found.
debug - 2024-12-06 13:53:58,851 -- Running preparation plugin: <class 'codecov_cli.plugins.gcov.GcovPlugin'>
debug - 2024-12-06 13:53:58,851 -- Running gcov plugin...
warning - 2024-12-06 13:53:58,872 -- No gcov data found.
debug - 2024-12-06 13:53:58,872 -- Running preparation plugin: <class 'codecov_cli.plugins.pycoverage.Pycoverage'>
warning - 2024-12-06 13:53:58,872 -- coverage.py is not installed or can't be found.
debug - 2024-12-06 13:53:58,872 -- Collecting relevant files
info - 2024-12-06 13:53:58,883 -- Found 1 coverage files to report
info - 2024-12-06 13:53:58,883 -- > /home/runner/work/humanize/humanize/coverage.xml
debug - 2024-12-06 13:53:58,886 -- Selected uploader to use: <class 'codecov_cli.services.upload.upload_sender.UploadSender'>
debug - 2024-12-06 13:53:58,887 -- Sending upload request to Codecov
info - 2024-12-06 13:53:59,226 -- Process Upload complete
debug - 2024-12-06 13:53:59,227 -- Upload result --- {"result": "RequestResult(error=RequestError(code='HTTP Error 400', params={}, description='{\"message\":\"Token required because branch is protected\"}\\n'), warnings=[], status_code=400, text='{\"message\":\"Token required because branch is protected\"}\\n')"}
error - 2024-12-06 13:53:59,227 -- Upload failed: {"message":"Token required because branch is protected"}

https://github.com/python-humanize/humanize/actions/runs/12199990414/job/34035117352?pr=220#step:9:263

@thomasrockhu-codecov
Copy link
Contributor

@hugovk, I believe it's turned on for you and not for the org python-humanize. You will need to get an admin of that org (or you if you are one) to flip the toggle in order to use tokenless.

@thomasrockhu-codecov
Copy link
Contributor

@H0R5E the same is true for the org DTOcean

@H0R5E
Copy link

H0R5E commented Dec 6, 2024

@thomasrockhu-codecov, thanks. Sorry for the erroneous report. I thought I'd done this already. Thanks for your help.

@thomasrockhu-codecov
Copy link
Contributor

@H0R5E no problem! Was worth digging into myself to figure it out

@hugovk
Copy link
Author

hugovk commented Dec 7, 2024

@hugovk, I believe it's turned on for you and not for the org python-humanize. You will need to get an admin of that org (or you if you are one) to flip the toggle in order to use tokenless.

Done!

I see the mistake I made, mixing up two different orgs here:

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".

I've flipped the toggle and it's working now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high High Priority Issues (to be fixed within 2 sprints)
Projects
None yet
Development

No branches or pull requests

4 participants