Open Cardds opened 11 hours ago
@Cardds I pushed out 5.0.3
, would you be able to see if that works for you?
@thomasrockhu-codecov
~Still saying Fork detected, tokenless uploading used but at least it now uploads to codecov.io, so it somehow uses the token correctly now~ 👍🏻
EDIT: PRs not working....
@thomasrockhu-codecov No dice, but different error (see below for log output). May need quotes around ${{ inputs.token }}
on https://github.com/codecov/codecov-action/blob/v5.0.3/action.yml#L172 .
Run codecov/codecov-action@v5.0.3
with:
files: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
flags: unit
fail_ci_if_error: true
token: ***
disable_file_fixes: false
disable_search: false
disable_safe_directory: false
dry_run: 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:
ENV: test
COVERAGE_FILE_NAME: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
pythonLocation: /opt/hostedtoolcache/Python/3.9.20/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib
Run git config --global --add safe.directory /home/runner/work/emrapi/emrapi
git config --global --add safe.directory /home/runner/work/emrapi/emrapi
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
ENV: test
COVERAGE_FILE_NAME: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
pythonLocation: /opt/hostedtoolcache/Python/3.9.20/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.20/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"
else
if [ -n ***
];
then
CC_TOKEN=***
echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV"
fi
fi
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
ENV: test
COVERAGE_FILE_NAME: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
pythonLocation: /opt/hostedtoolcache/Python/3.9.20/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib
/home/runner/work/_temp/39200f11-324e-4f9e-b99d-a06f5874825b.sh: line 7: [: missing `]'
/home/runner/work/_temp/39200f11-324e-4f9e-b99d-a06f5874825b.sh: line 8: ]: command not found
Run if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ -n "$GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME"] && [ "${GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME}" != "$GITHUB_REPOSITORY" ];
if [ -z "$CC_BRANCH" ] && [ -z "$CC_TOKEN" ] && [ -n "$GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME"] && [ "${GITHUB_EVENT_PULL_REQUEST_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:
ENV: test
COVERAGE_FILE_NAME: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
pythonLocation: /opt/hostedtoolcache/Python/3.9.20/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib
CC_BRANCH:
GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL:
GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME:
GITHUB_REPOSITORY: VillageMD/emrapi
==> Fork detected, tokenless uploading used
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:
ENV: test
COVERAGE_FILE_NAME: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
pythonLocation: /opt/hostedtoolcache/Python/3.9.20/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib
TOKENLESS:
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:
ENV: test
COVERAGE_FILE_NAME: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
pythonLocation: /opt/hostedtoolcache/Python/3.9.20/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.20/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.20/x64/lib
TOKENLESS:
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: true
CC_FILES: coverage-unit-f198527b1d67f1af785ea1984bef06a6061b9e72.xml
CC_FLAGS: unit
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: false
CC_VERSION: latest
CC_YML_PATH:
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Wrapper-0.0.24
==> Detected linux
-> Downloading https://cli.codecov.io/latest/linux/codecov
==> Finishing downloading linux:latest
Version: v9.0.4
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: /home/runner/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: 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:59: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 --fail-on-error --git-service github
info - 2024-11-19 22:12:09,108 -- ci service found: github-actions
info - 2024-11-19 22:12:09,338 -- Process Commit creating complete
error - 2024-11-19 22:12:09,339 -- Commit creating failed: {"message":"Token required - not valid tokenless upload"}
==> Failed to create-commit
Exiting...
Error: Process completed with exit code 1.
Mmm spoke to soon, PRs still not passing the CI run with 5.0.3.
@Cardds I believe you might have a newline character at the end of your CODECOV_TOKEN, can you double-check that?
@MarcHagen are you able to link that CI run by chance?
@MarcHagen are you able to link that CI run by chance?
No sorry, private repo in (non-public) organization.
@MarcHagen ahhh, tokens are required for all PRs into private repositories.
@MarcHagen ahhh, tokens are required for all PRs into private repositories.
I know that is why the token is provided with in the action (also for PRs). And it worked perfectly fine until 5.x referring to my original comment: https://github.com/codecov/codecov-action/issues/1645#issuecomment-2483261997 We also have required upload tokens enabled in the codecov org/team.
OR are you referring to the input token
field?
Why is the env var CODECOV_TOKEN
not used?
@MarcHagen got it! ok, let me check with the product team
Upon upgrade to
codecov/codecov-action@v5
fromcodecov/codecov-action@v4
, the action begins to fail, citingToken required - not valid tokenless upload
.This appears to occur as a result of the branch that results in message
Fork detected, tokenless uploading used
.Relevant workflow snippet:
GH action logs:
This issue also appears to be described in https://github.com/codecov/codecov-action/issues/1645#issuecomment-2483261997