From 75dfc33f31ec9231954337ef821c860fcb383b33 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sat, 8 Jun 2024 14:04:40 +0200 Subject: [PATCH] Properly pass codecov-token to composite action Turns out that in order to pass secret to a composite action you need to pass it as input. Further follow up on #40136 and #40128 --- .github/actions/post_tests_success/action.yml | 7 ++++++- .github/workflows/integration-tests.yml | 2 ++ .github/workflows/run-unit-tests.yml | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/post_tests_success/action.yml b/.github/actions/post_tests_success/action.yml index f7803c0b71577..e8cdfa4602b9d 100644 --- a/.github/actions/post_tests_success/action.yml +++ b/.github/actions/post_tests_success/action.yml @@ -18,6 +18,11 @@ --- name: 'Post tests on success' description: 'Run post tests actions on success' +inputs: + codecov-token: + description: 'Codecov token' + required: true + default: '' runs: using: "composite" steps: @@ -37,7 +42,7 @@ runs: - name: "Upload all coverage reports to codecov" uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} + CODECOV_TOKEN: ${{ inputs.codecov-token }} if: env.ENABLE_COVERAGE == 'true' && env.TEST_TYPES != 'Helm' with: name: coverage-${{env.JOB_ID}} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index df9b06fbfc31a..e10447a01a5ba 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -94,6 +94,8 @@ jobs: run: ./scripts/ci/testing/run_integration_tests_with_retry.sh ${{ matrix.integration }} - name: "Post Tests success: Integration Tests ${{ matrix.integration }}" uses: ./.github/actions/post_tests_success + with: + codecov-token: ${{ secrets.CODECOV_TOKEN }} - name: "Post Tests failure: Integration Tests ${{ matrix.integration }}" uses: ./.github/actions/post_tests_failure if: failure() diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index d10032241259f..ae108e79813a8 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -195,6 +195,8 @@ jobs: fi - name: "Post Tests success" uses: ./.github/actions/post_tests_success + with: + codecov-token: ${{ secrets.CODECOV_TOKEN }} if: success() - name: "Post Tests failure" uses: ./.github/actions/post_tests_failure