Skip to content

Commit a22660f

Browse files
Limit public OIDC diagnostics to publisher identity
1 parent f8a0603 commit a22660f

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,8 @@ jobs:
7272
const claims = JSON.parse(Buffer.from(encodedClaims, 'base64url').toString());
7373
// Log only identity metadata, never the signed token or exchanged credential.
7474
const claimNames = [
75-
'iss', 'aud', 'sub', 'issuer_scope', 'repository', 'repository_id', 'repository_owner',
76-
'repository_owner_id', 'repository_visibility', 'workflow', 'workflow_ref',
77-
'workflow_sha', 'job_workflow_ref', 'job_workflow_sha', 'ref', 'ref_type', 'sha',
78-
'head_ref', 'base_ref', 'ref_protected', 'environment', 'environment_node_id',
79-
'enterprise', 'enterprise_id', 'runner_environment', 'event_name', 'check_run_id',
80-
'actor', 'actor_id', 'run_id', 'run_number', 'run_attempt', 'iat', 'nbf', 'exp',
75+
'iss', 'aud', 'sub', 'repository', 'workflow_ref', 'job_workflow_ref',
76+
'environment', 'runner_environment', 'event_name',
8177
];
8278
const identity = Object.fromEntries(claimNames.map((name) => [name, claims[name] ?? null]));
8379
core.info(JSON.stringify({alg: header.alg, kid: header.kid, claims: identity}, null, 2));
@@ -93,12 +89,8 @@ jobs:
9389
const value = response.headers.get(name);
9490
if (value) core.info(`${name}: ${value}`);
9591
}
96-
if (response.ok) {
97-
await response.body?.cancel();
98-
} else {
99-
const body = await response.json();
100-
core.warning(typeof body.message === 'string' ? body.message : 'npm rejected the token exchange');
101-
}
92+
// The response can contain an npm credential; never read or log its body.
93+
await response.body?.cancel();
10294
- name: Force snapshot changeset
10395
if: ${{ github.event.comment.body == '/snapit' }}
10496
run: "mv .changeset/force-snapshot-build.md.ignore .changeset/force-snapshot-build.md"

0 commit comments

Comments
 (0)