@@ -41,21 +41,20 @@ jobs:
4141 // retrieve the ambient OIDC token
4242 const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
4343 const oidc_request_url = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
44- const oidc_resp = await github.request({
45- url: `${oidc_request_url}&audience=testpypi`,
44+ const oidc_resp = await fetch(`${oidc_request_url}&audience=testpypi`, {
4645 headers: {Authorization: `bearer ${oidc_request_token}`},
4746 }
4847 );
49- const oidc_token = oidc_resp.data .value;
50-
48+ const oidc_token = (await oidc_resp.json()) .value;
49+
5150 // exchange the OIDC token for an API token
52- const mint_resp = await github.request( {
53- url : 'https://test.pypi.org/_/oidc/github/mint-token ',
54- method : 'post' ,
55- headers: {'Content-Type': 'application/json'},
56- token: oidc_token,
57- } );
58- const api_token = mint_resp.data .token;
51+ const mint_resp = await fetch('https://test.pypi.org/_/oidc/github/mint-token', {
52+ method : ' post ' ,
53+ body : ' {"token": "oidc_token"} ' ,
54+ headers : {'Content-Type': 'application/json'},
55+ }
56+ );
57+ const api_token = (await mint_resp.json()) .token;
5958
6059 // mask the newly minted API token, so that we don't accidentally leak it
6160 core.setSecret(api_token)
0 commit comments