From 817417463cf4812f7b3ea35373dc15b7307d0755 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 11 May 2024 20:40:20 +0200 Subject: [PATCH 1/2] Allow to pass in the codecov token Version 4 of the codecov uploader prefers to have the token handed over explicitly. --- README.md | 5 +++++ action.yml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 6f9dad2..46a5153 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,11 @@ ansible-core 2.12 or later when `target-python-version` is also specified **(DEFAULT: `auto`)** +### `codecov-token` + +The Codecov token to use when uploading coverage data. **(OPTIONAL)** + + ### `collection-root` Path to collection root relative to repository root **(DEFAULT: `.`)** diff --git a/action.yml b/action.yml index e6a8824..06a6fb4 100644 --- a/action.yml +++ b/action.yml @@ -18,6 +18,9 @@ inputs: ansible-core-github-repository-slug: description: The GitHub repository slug from which to check out ansible-core default: ansible/ansible + codecov-token: + description: >- + The Codecov token to use when uploading coverage data. controller-python-version: description: >- Controller Python version. Only used for integration tests and @@ -682,6 +685,7 @@ runs: inputs.testing-type }}=*.xml flags: ${{ inputs.testing-type }} + token: ${{ inputs.codecov-token }} - name: Produce markdown test summary from JUnit if: always() From 21fa8bcf47ab1147b67c32b917b478b7d5f0004e Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 11 May 2024 20:40:29 +0200 Subject: [PATCH 2/2] Bump codecov/codecov-action to v4.3.1 Need to add working-directory so it finds the checkout. --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 06a6fb4..5a83985 100644 --- a/action.yml +++ b/action.yml @@ -676,7 +676,7 @@ runs: Send the coverage data over to https://codecov.io/gh/${{ github.repository }} if: steps.ansible-test-command.outputs.has-coverage == 'true' - uses: codecov/codecov-action@v3.1.6 + uses: codecov/codecov-action@v4.3.1 with: files: >- ${{ @@ -686,6 +686,7 @@ runs: }}=*.xml flags: ${{ inputs.testing-type }} token: ${{ inputs.codecov-token }} + working-directory: ${{ steps.collection-metadata.outputs.checkout-path }} - name: Produce markdown test summary from JUnit if: always()