Skip to content

Commit

Permalink
Fix github-script syntax in create-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jul 24, 2023
1 parent a539ce7 commit 3d43b9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/create-release.yml
Expand Up @@ -41,20 +41,20 @@ jobs:
// retrieve the ambient OIDC token
const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
const oidc_request_url = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
const resp = await fetch(`${oidc_request_url}&audience=testpypi`, {
const oidc_resp = await fetch(`${oidc_request_url}&audience=testpypi`, {
headers: {Authorization: `bearer ${oidc_request_token}`},
}
);
const oidc_token = (await response.json()).value;
const oidc_token = (await oidc_resp.json()).value;
// exchange the OIDC token for an API token
const resp = await fetch('https://pypi.org/_/oidc/github/mint-token', {
const mint_resp = await fetch('https://pypi.org/_/oidc/github/mint-token', {
method: 'post',
body: '{"token": "oidc_token"}' ,
headers: {'Content-Type': 'application/json'},
}
);
const api_token = (await response.json()).token;
const api_token = (await mint_resp.json()).token;

// mask the newly minted API token, so that we don't accidentally leak it
core.setSecret(api_token)
Expand Down

0 comments on commit 3d43b9e

Please sign in to comment.