X Tutup
Skip to content

Commit e8d25d3

Browse files
authored
fix(ci): use upstream script
1 parent 1e4b4c6 commit e8d25d3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ jobs:
2020
- name: mint API token
2121
id: mint-token
2222
run: |
23-
oidc_token=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=testpypi" | jq '.value')
24-
api_token=$(curl -X POST https://test.pypi.org/_/oidc/github/mint-token -d "{\"token\": \"${oidc_token}\"}" | jq '.token' | tr -d '"')
25-
echo "OIDC token: $oidc_token"
26-
echo "pypi token: $api_token"
23+
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
24+
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=testpypi")
25+
oidc_token=$(jq '.value' <<< "${resp}")
26+
resp=$(curl -X POST https://test.pypi.org/_/oidc/github/mint-token -d "{\"token\":${oidc_token}}")
27+
api_token=$(jq '.token' <<< "${resp}")
28+
api_token=$(echo ${api_token:1:-1})
29+
echo "response: ${resp}"
30+
echo "oidc token: $oidc_token"
31+
echo "api token: $api_token"
2732
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
2833
- name: Python Semantic Release
2934
uses: relekang/python-semantic-release@v7.33.2

0 commit comments

Comments
 (0)
X Tutup