mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Revert "Switch to using `github.request
`"
This reverts commit f9c89e5d84
.
This commit is contained in:
parent
f9c89e5d84
commit
258b0ea9fc
21
.github/workflows/create-release.yml
vendored
21
.github/workflows/create-release.yml
vendored
@ -41,21 +41,20 @@ jobs:
|
|||||||
// retrieve the ambient OIDC token
|
// retrieve the ambient OIDC token
|
||||||
const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
|
const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
|
||||||
const oidc_request_url = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
|
const oidc_request_url = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
|
||||||
const oidc_resp = await github.request({
|
const oidc_resp = await fetch(`${oidc_request_url}&audience=testpypi`, {
|
||||||
url: `${oidc_request_url}&audience=testpypi`,
|
|
||||||
headers: {Authorization: `bearer ${oidc_request_token}`},
|
headers: {Authorization: `bearer ${oidc_request_token}`},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const oidc_token = oidc_resp.data.value;
|
const oidc_token = (await oidc_resp.json()).value;
|
||||||
|
|
||||||
// exchange the OIDC token for an API token
|
// exchange the OIDC token for an API token
|
||||||
const mint_resp = await github.request({
|
const mint_resp = await fetch('https://test.pypi.org/_/oidc/github/mint-token', {
|
||||||
url: 'https://test.pypi.org/_/oidc/github/mint-token',
|
method: 'post',
|
||||||
method: 'post',
|
body: '{"token": "oidc_token"}' ,
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: {'Content-Type': 'application/json'},
|
||||||
token: oidc_token,
|
}
|
||||||
});
|
);
|
||||||
const api_token = mint_resp.data.token;
|
const api_token = (await mint_resp.json()).token;
|
||||||
|
|
||||||
// mask the newly minted API token, so that we don't accidentally leak it
|
// mask the newly minted API token, so that we don't accidentally leak it
|
||||||
core.setSecret(api_token)
|
core.setSecret(api_token)
|
||||||
|
Loading…
Reference in New Issue
Block a user