From 08502218f2286fdc8f2097b8ecf54c46310bff44 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Tue, 19 Nov 2024 14:31:10 -0500 Subject: [PATCH 1/7] dnm: whats the token --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 2b390f34f..728a0ca41 100644 --- a/action.yml +++ b/action.yml @@ -167,6 +167,7 @@ runs: then # {"count":1984,"value":"***"} 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 echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" else if [ -n ${{ inputs.token }} ]; From 5cc3f56186addb5257484c4ab9155dae2434bf68 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Tue, 19 Nov 2024 14:36:39 -0500 Subject: [PATCH 2/7] fix: show the url --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 728a0ca41..5752abd37 100644 --- a/action.yml +++ b/action.yml @@ -166,6 +166,7 @@ runs: if [ ${{ inputs.use_oidc }} == 'true' ]; then # {"count":1984,"value":"***"} + curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" 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 echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" From 78f3eea7c78d2cac6c786c8c781e5afb628b3fee Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Tue, 19 Nov 2024 14:38:09 -0500 Subject: [PATCH 3/7] fix: do the echo --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 5752abd37..d83988261 100644 --- a/action.yml +++ b/action.yml @@ -166,6 +166,7 @@ runs: if [ ${{ inputs.use_oidc }} == 'true' ]; then # {"count":1984,"value":"***"} + echo "$ACTIONS_ID_TOKEN_REQUEST_URL" curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" 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 From 3717491f16bbbcf80900bf96c05891b622065376 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Tue, 19 Nov 2024 14:39:18 -0500 Subject: [PATCH 4/7] fix: just echo --- action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index d83988261..f37916b1f 100644 --- a/action.yml +++ b/action.yml @@ -167,10 +167,10 @@ runs: then # {"count":1984,"value":"***"} echo "$ACTIONS_ID_TOKEN_REQUEST_URL" - curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" - 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 - echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" + #curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" + #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 + #echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" else if [ -n ${{ inputs.token }} ]; then From 038c89eb32d49ed0412c5c129332c6ec69caf80d Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Tue, 19 Nov 2024 14:40:10 -0500 Subject: [PATCH 5/7] fix: true == true --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f37916b1f..5dba32b56 100644 --- a/action.yml +++ b/action.yml @@ -163,7 +163,7 @@ runs: - name: Get and set token shell: bash run: | - if [ ${{ inputs.use_oidc }} == 'true' ]; + if [ "${{ inputs.use_oidc }}" == 'true' ]; then # {"count":1984,"value":"***"} echo "$ACTIONS_ID_TOKEN_REQUEST_URL" From 7f49fedfd52225c8657def0c01ebf03ea7636351 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Tue, 19 Nov 2024 14:40:53 -0500 Subject: [PATCH 6/7] fix get the action --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 5dba32b56..5fca0d4ad 100644 --- a/action.yml +++ b/action.yml @@ -166,6 +166,7 @@ runs: if [ "${{ inputs.use_oidc }}" == 'true' ]; then # {"count":1984,"value":"***"} + echo "meow" echo "$ACTIONS_ID_TOKEN_REQUEST_URL" #curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" #CC_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | cut -d\" -f6) From bc5663ec8dde6c8deaa43e503432706122a47180 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Tue, 19 Nov 2024 15:11:06 -0500 Subject: [PATCH 7/7] fix: use audience --- action.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 5fca0d4ad..f2fa3ab90 100644 --- a/action.yml +++ b/action.yml @@ -166,12 +166,8 @@ runs: if [ "${{ inputs.use_oidc }}" == 'true' ]; then # {"count":1984,"value":"***"} - echo "meow" - echo "$ACTIONS_ID_TOKEN_REQUEST_URL" - #curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" - #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 - #echo "CC_TOKEN=$CC_TOKEN" >> "$GITHUB_ENV" + 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 ${{ inputs.token }} ]; then