Skip to content

Commit e7cc33a

Browse files
authored
New OIDC fields added, including the GitHub job name and run ID (#231)
1 parent d788a32 commit e7cc33a

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

lib/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,17 @@ class Utils {
125125
const exchangeUrl = jfrogCredentials.jfrogUrl.replace(/\/$/, '') + '/access/api/v1/oidc/token';
126126
core.debug('Exchanging GitHub JSON web token with a JFrog access token...');
127127
let projectKey = process.env.JF_PROJECT || '';
128+
let jobId = process.env.GITHUB_JOB || '';
129+
let runId = process.env.GITHUB_RUN_ID || '';
128130
const httpClient = new http_client_1.HttpClient();
129131
const data = `{
130132
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
131133
"subject_token_type": "urn:ietf:params:oauth:token-type:id_token",
132134
"subject_token": "${jsonWebToken}",
133135
"provider_name": "${oidcProviderName}",
134-
"project_key": "${projectKey}"
136+
"project_key": "${projectKey}",
137+
"gh_job_id": "${jobId}",
138+
"gh_run_id": "${runId}"
135139
}`;
136140
const additionalHeaders = {
137141
'Content-Type': 'application/json',

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jfrog/setup-jfrog-cli",
3-
"version": "4.4.2",
3+
"version": "4.4.3",
44
"private": true,
55
"description": "Setup JFrog CLI in GitHub Actions",
66
"main": "lib/main.js",

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ export class Utils {
161161
"subject_token": "${jsonWebToken}",
162162
"provider_name": "${oidcProviderName}",
163163
"project_key": "${projectKey}",
164+
"gh_job_id": "${jobId}",
165+
"gh_run_id": "${runId}"
164166
}`;
165167

166168
const additionalHeaders: OutgoingHttpHeaders = {

0 commit comments

Comments
 (0)