diff --git a/lib/utils.js b/lib/utils.js index 0fe8d85e..3b96ecda 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -125,13 +125,17 @@ class Utils { const exchangeUrl = jfrogCredentials.jfrogUrl.replace(/\/$/, '') + '/access/api/v1/oidc/token'; core.debug('Exchanging GitHub JSON web token with a JFrog access token...'); let projectKey = process.env.JF_PROJECT || ''; + let jobId = process.env.GITHUB_JOB || ''; + let runId = process.env.GITHUB_RUN_ID || ''; const httpClient = new http_client_1.HttpClient(); const data = `{ "grant_type": "urn:ietf:params:oauth:grant-type:token-exchange", "subject_token_type": "urn:ietf:params:oauth:token-type:id_token", "subject_token": "${jsonWebToken}", "provider_name": "${oidcProviderName}", - "project_key": "${projectKey}" + "project_key": "${projectKey}", + "gh_job_id": "${jobId}", + "gh_run_id": "${runId}", }`; const additionalHeaders = { 'Content-Type': 'application/json', diff --git a/src/utils.ts b/src/utils.ts index e4e8a442..b61ba41b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -151,6 +151,8 @@ export class Utils { core.debug('Exchanging GitHub JSON web token with a JFrog access token...'); let projectKey: string = process.env.JF_PROJECT || ''; + let jobId: string = process.env.GITHUB_JOB || ''; + let runId: string = process.env.GITHUB_RUN_ID || ''; const httpClient: HttpClient = new HttpClient(); const data: string = `{ @@ -158,7 +160,9 @@ export class Utils { "subject_token_type": "urn:ietf:params:oauth:token-type:id_token", "subject_token": "${jsonWebToken}", "provider_name": "${oidcProviderName}", - "project_key": "${projectKey}" + "project_key": "${projectKey}", + "gh_job_id": "${jobId}", + "gh_run_id": "${runId}", }`; const additionalHeaders: OutgoingHttpHeaders = {