Skip to content

Commit 258b0ea

Browse files
committed
Revert "Switch to using github.request"
This reverts commit f9c89e5.
1 parent f9c89e5 commit 258b0ea

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/create-release.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)