Skip to content

Commit

Permalink
final composite actions mint test
Browse files Browse the repository at this point in the history
  • Loading branch information
AyodeAwe committed Jun 26, 2024
1 parent ad7439c commit 84791a9
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,31 @@ jobs:
id-token: write
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=pypi")
# 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}"
# see the next step in the workflow for an example of using this step output
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
# # 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}"
- name: Mint GitHub Token
uses: rapidsai/shared-actions/mint-pypi-token@mint-pypi-token
id: mint-token
Expand Down

0 comments on commit 84791a9

Please sign in to comment.