Skip to content

Commit

Permalink
New OIDC fields added, including the GitHub job name and run ID (jfro…
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalbe4 authored Dec 1, 2024
1 parent d788a32 commit e7cc33a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jfrog/setup-jfrog-cli",
"version": "4.4.2",
"version": "4.4.3",
"private": true,
"description": "Setup JFrog CLI in GitHub Actions",
"main": "lib/main.js",
Expand Down
2 changes: 2 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ export class Utils {
"subject_token": "${jsonWebToken}",
"provider_name": "${oidcProviderName}",
"project_key": "${projectKey}",
"gh_job_id": "${jobId}",
"gh_run_id": "${runId}"
}`;

const additionalHeaders: OutgoingHttpHeaders = {
Expand Down

0 comments on commit e7cc33a

Please sign in to comment.