@@ -41,21 +41,20 @@ jobs:
41
41
// retrieve the ambient OIDC token
42
42
const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
43
43
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`, {
46
45
headers: {Authorization: `bearer ${oidc_request_token}`},
47
46
}
48
47
);
49
- const oidc_token = oidc_resp.data .value;
50
-
48
+ const oidc_token = (await oidc_resp.json()) .value;
49
+
51
50
// 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;
59
58
60
59
// mask the newly minted API token, so that we don't accidentally leak it
61
60
core.setSecret(api_token)
0 commit comments