Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions lib/oidc-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class OidcUtils {
* @private
*/
static buildOidcTokenExchangePayload(jwt, providerName, applicationKey) {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b, _c, _d, _e, _f;
return {
grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange',
subject_token_type: 'urn:ietf:params:oauth:token-type:id_token',
Expand All @@ -246,16 +246,11 @@ class OidcUtils {
gh_repo: (_d = process.env.GITHUB_REPOSITORY) !== null && _d !== void 0 ? _d : '',
gh_revision: (_e = process.env.GITHUB_SHA) !== null && _e !== void 0 ? _e : '',
gh_branch: (_f = process.env.GITHUB_REF_NAME) !== null && _f !== void 0 ? _f : '',
// AppTrust context parameters
repo: process.env.GITHUB_REPOSITORY,
revision: process.env.GITHUB_SHA,
branch: process.env.GITHUB_REF_NAME,
application_key: applicationKey,
// This object is planned to be expanded as needed
// even though currently it contains some duplicated parameters
context: {
vcs_commit: {
vcs_url: utils_1.Utils.buildVcsUrl(),
branch: (_g = process.env.GITHUB_REF_NAME) !== null && _g !== void 0 ? _g : '',
revision: (_h = process.env.GITHUB_SHA) !== null && _h !== void 0 ? _h : '',
},
},
};
}
/**
Expand Down
13 changes: 4 additions & 9 deletions src/oidc-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,11 @@ export class OidcUtils {
gh_repo: process.env.GITHUB_REPOSITORY ?? '',
gh_revision: process.env.GITHUB_SHA ?? '',
gh_branch: process.env.GITHUB_REF_NAME ?? '',
// AppTrust context parameters
repo: process.env.GITHUB_REPOSITORY,
revision: process.env.GITHUB_SHA,
branch: process.env.GITHUB_REF_NAME,
application_key: applicationKey,
// This object is planned to be expanded as needed
// even though currently it contains some duplicated parameters
context: {
vcs_commit: {
vcs_url: Utils.buildVcsUrl(),
branch: process.env.GITHUB_REF_NAME ?? '',
revision: process.env.GITHUB_SHA ?? '',
},
},
};
}

Expand Down
Loading