From 06425412c8015bc1ab2385b41c7ea204f77b91bf Mon Sep 17 00:00:00 2001 From: Tom Hu <88201630+thomasrockhu-codecov@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:44:36 -0500 Subject: [PATCH 1/4] fix: use marketplace v5 badge (#1646) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bcba0ece6..bc1fa5504 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Codecov GitHub Action -[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v4-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov) +[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-v5-undefined.svg?logo=github&logoColor=white&style=flat)](https://github.com/marketplace/actions/codecov) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-action?ref=badge_shield) [![Workflow for Codecov Action](https://github.com/codecov/codecov-action/actions/workflows/main.yml/badge.svg)](https://github.com/codecov/codecov-action/actions/workflows/main.yml) ### Easily upload coverage reports to Codecov from GitHub Actions @@ -11,11 +11,11 @@ ### Migration Guide The `v5` release also coincides with the opt-out feature for tokens for public repositories. In the repository settings page in codecov.io, you can set the ability for Codecov to receive a coverage report from ANY souce. This will allow contributors or other members of a repository to upload without needing access to the Codecov token. -> [!WARNING] +> [!WARNING] > **The following arguments have been changed** > - `file` (this has been deprecated in favor of `files`) > - `plugin` (this has been deprecated in favor of `plugins`) - + The following arguments have been added: - `binary` From cfc521b7a1dcdbcf0ecf149c162c19ff9bd9568c Mon Sep 17 00:00:00 2001 From: Tom Hu <88201630+thomasrockhu-codecov@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:55:33 -0500 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc1fa5504..4c08455d7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ `v5` of the Codecov GitHub Action will use the [Codecov Wrapper](https://github.com/codecov/wrapper) to encapsulate the [CLI](https://github.com/codecov/codecov-cli). This will help ensure that the Action gets updates quicker. ### Migration Guide -The `v5` release also coincides with the opt-out feature for tokens for public repositories. In the repository settings page in codecov.io, you can set the ability for Codecov to receive a coverage report from ANY souce. This will allow contributors or other members of a repository to upload without needing access to the Codecov token. +The `v5` release also coincides with the opt-out feature for tokens for public repositories. In the `Global Upload Token` section of the settings page of an organization in codecov.io, you can set the ability for Codecov to receive a coverage reports from any source. This will allow contributors or other members of a repository to upload without needing access to the Codecov token. For more details see [how to upload without a token](https://docs.codecov.com/docs/codecov-tokens#uploading-without-a-token). > [!WARNING] > **The following arguments have been changed** From 2e2a9c6d5862d22e0f8cfb59d46bc47bf8eb1fe0 Mon Sep 17 00:00:00 2001 From: Tom Hu <88201630+thomasrockhu-codecov@users.noreply.github.com> Date: Fri, 15 Nov 2024 07:50:22 -0500 Subject: [PATCH 3/4] fix: update tokenless branch logic (#1650) * fix: update tokenless branch logic * fix: use the github context * fix: use double quotes * fix: lots of quotes * fix: ai fixes * fix: just shove it in * fix: more ai fixes * fix: missing double quote * fix: more clenaup * fix: add CC_BRANCH setting for not forks * fix: cleanup * fix: more cleanup --- action.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index bcbc9b942..a2959d073 100644 --- a/action.yml +++ b/action.yml @@ -175,13 +175,32 @@ runs: echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> $GITHUB_ENV fi fi + + - name: Override branch for forks + shell: bash + run: | + if [ -z "$CC_BRANCH" ] && [ -z "$CODECOV_TOKEN" ] && [ "${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 + env: + CC_BRANCH: ${{ inputs.override_branch }} + GITHUB_EVENT_PULL_REQUEST_HEAD_LABEL: ${{ github.event.pull_request.head.label }} + GITHUB_EVENT_PULL_REQUEST_REPO_FULL_NAME: ${{ github.event.pull_request.repo.full_name }} + GITHUB_REPOSITORY: ${{ github.repository }} + - name: Upload coverage to Codecov run: ${GITHUB_ACTION_PATH}/dist/codecov.sh shell: bash working-directory: ${{ inputs.working-directory }} env: CC_BINARY: ${{ inputs.binary }} - CC_BRANCH: ${{ inputs.override_branch }} + CC_BRANCH: $CC_BRANCH CC_BUILD: ${{ inputs.override_build }} CC_BUILD_URL: ${{ inputs.override_build_url }} CC_CODE: ${{ inputs.report_code }} From 3b1354a6c45db9f1008891f4eafc1a7e94ce1d18 Mon Sep 17 00:00:00 2001 From: Tom Hu <88201630+thomasrockhu-codecov@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:33:30 -0500 Subject: [PATCH 4/4] chore(release): 5.0.1 (#1656) --- VERSION | 1 - dist/codecov.sh | 4 ++-- src/scripts | 2 +- src/version | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 VERSION diff --git a/VERSION b/VERSION deleted file mode 100644 index 59790ac77..000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-beta diff --git a/dist/codecov.sh b/dist/codecov.sh index 6f534ea2e..f32ee2f66 100755 --- a/dist/codecov.sh +++ b/dist/codecov.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -CC_WRAPPER_VERSION="0.0.23" +CC_WRAPPER_VERSION="0.0.24" set +u say() { echo -e "$1" @@ -134,6 +134,7 @@ cc_cr_args+=( $(write_existing_args CC_PR) ) cc_cr_args+=( $(write_existing_args CC_SHA) ) cc_cr_args+=( $(write_existing_args CC_SLUG) ) cc_du_args=() +cc_du_args+=( $(write_existing_args CC_ENV) ) OLDIFS=$IFS;IFS=, cc_du_args+=( $(write_existing_args CC_BRANCH) ) cc_du_args+=( $(write_existing_args CC_BUILD) ) @@ -143,7 +144,6 @@ cc_du_args+=( $(write_existing_args CC_DIR) ) cc_du_args+=( $(write_truthy_args CC_DISABLE_FILE_FIXES) ) cc_du_args+=( $(write_truthy_args CC_DISABLE_SEARCH) ) cc_du_args+=( $(write_truthy_args CC_DRY_RUN) ) -cc_du_args+=( $(write_existing_args CC_ENV) ) if [ -n "$CC_EXCLUDES" ]; then for directory in $CC_EXCLUDES; do diff --git a/src/scripts b/src/scripts index c4d213e68..25f50b4c5 160000 --- a/src/scripts +++ b/src/scripts @@ -1 +1 @@ -Subproject commit c4d213e6887bffb87543c40cd3bb8eb93b264221 +Subproject commit 25f50b4c5b5c0c94e7af4776c06b22762a18389c diff --git a/src/version b/src/version index 9fc09b802..824b8f25f 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -CODECOV_ACTION_VERSION="5.0.0" +CODECOV_ACTION_VERSION="5.0.1"