From 32e4448d4e5159858dd153369d45ae76b06acf36 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Mon, 18 Nov 2024 21:32:45 -0500 Subject: [PATCH 1/4] fix: get log for use oidc --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 36e11f2fa..982f1a15d 100644 --- a/action.yml +++ b/action.yml @@ -166,6 +166,8 @@ runs: if [ ${{ inputs.use_oidc }} == 'true' ]; then # {"count":1984,"value":"***"} + MEOW=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange") + echo $MEOW CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | cut -d\' -f6) echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" else From ddffdd41c0815eded3097f2edc8c89913716875f Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Mon, 18 Nov 2024 21:33:23 -0500 Subject: [PATCH 2/4] fix: add oidc run --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6bc400424..db1674151 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -116,6 +116,14 @@ jobs: name: codecov-demo verbose: true token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage to Codecov (oidc) + uses: ./ + with: + files: ./coverage/script/coverage-final.json + flags: script,${{ matrix.os }} + name: codecov-script + use_oidc: true + verbose: true - name: Upload coverage to Codecov (version) uses: ./ with: From 949f80455ab674ce19b4561e6f4fd5c7a9e1df8d Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Mon, 18 Nov 2024 21:34:38 -0500 Subject: [PATCH 3/4] fix: move the oidc call --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db1674151..4c6106e93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,6 +78,14 @@ jobs: name: codecov-demo verbose: true token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage to Codecov (oidc) + uses: ./ + with: + files: ./coverage/script/coverage-final.json + flags: script,${{ matrix.os }} + name: codecov-script + use_oidc: true + verbose: true - name: Upload coverage to Codecov (version) uses: ./ with: @@ -116,14 +124,6 @@ jobs: name: codecov-demo verbose: true token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload coverage to Codecov (oidc) - uses: ./ - with: - files: ./coverage/script/coverage-final.json - flags: script,${{ matrix.os }} - name: codecov-script - use_oidc: true - verbose: true - name: Upload coverage to Codecov (version) uses: ./ with: From e597739920a66c0e4adc684077f3a9d8bc23382e Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Mon, 18 Nov 2024 21:35:42 -0500 Subject: [PATCH 4/4] fix: update to use double quote on oidc --- action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 982f1a15d..d02352078 100644 --- a/action.yml +++ b/action.yml @@ -166,9 +166,7 @@ runs: if [ ${{ inputs.use_oidc }} == 'true' ]; then # {"count":1984,"value":"***"} - MEOW=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange") - echo $MEOW - CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | cut -d\' -f6) + CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | cut -d\" -f6) echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" else if [ -n ${{ inputs.token }} ];