Skip to content

Commit

Permalink
use correct audience
Browse files Browse the repository at this point in the history
  • Loading branch information
AyodeAwe committed Jun 26, 2024
1 parent 84791a9 commit 0829264
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,33 +72,33 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
needs: wheel-build
# needs: wheel-build
steps:
# - name: mint API token
# run: |
# #!/bin/bash
- name: mint API token
run: |
#!/bin/bash
# # retrieve the ambient OIDC token
# resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
# "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
# oidc_token=$(jq -r '.value' <<< "${resp}")
# retrieve the ambient OIDC token
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=testpypi")
oidc_token=$(jq -r '.value' <<< "${resp}")
# echo "OIDC token: $oidc_token"
# echo "Response: $resp"
echo "OIDC token: $oidc_token"
echo "Response: $resp"
# # exchange the OIDC token for an API token
# resp=$(curl -X POST https://test.pypi.org/_/oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
# exchange the OIDC token for an API token
resp=$(curl -X POST https://test.pypi.org/_/oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
# echo "OIDC token: $oidc_token"
# echo "Response: $resp"
echo "OIDC token: $oidc_token"
echo "Response: $resp"
# api_token=$(jq -r '.token' <<< "${resp}")
api_token=$(jq -r '.token' <<< "${resp}")
# # mask the newly minted API token, so that we don't accidentally leak it
# echo "::add-mask::${api_token}"
# mask the newly minted API token, so that we don't accidentally leak it
echo "::add-mask::${api_token}"
# # see the next step in the workflow for an example of using this step output
# echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
# see the next step in the workflow for an example of using this step output
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
- name: Mint GitHub Token
uses: rapidsai/shared-actions/mint-pypi-token@mint-pypi-token
id: mint-token
Expand Down
2 changes: 1 addition & 1 deletion ci/mint-pypi-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# retrieve the ambient OIDC token
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=testpypi")
oidc_token=$(jq -r '.value' <<< "${resp}")

echo "OIDC token: $oidc_token"
Expand Down

0 comments on commit 0829264

Please sign in to comment.