From fa12407b7bdcae8bc093b38bc25b7ef37bb66516 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Thu, 8 Jan 2026 12:16:51 +0200 Subject: [PATCH 1/3] FF-000 - Skip git info collection when no .git directory exists --- src/cleanup.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cleanup.ts b/src/cleanup.ts index d5f72abb6..5360ac177 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -105,7 +105,12 @@ async function collectAndPublishBuildInfoIfNeeded() { // We allow this step to fail, and we don't want to fail the entire build publish if they do. try { core.startGroup('Collect the Git information'); - await Utils.runCli(['rt', 'build-add-git'], { cwd: workingDirectory }); + const gitDir: string = require('path').join(workingDirectory, '.git'); + if (require('fs').existsSync(gitDir)) { + await Utils.runCli(['rt', 'build-add-git'], { cwd: workingDirectory }); + } else { + core.info('No .git directory found. Skipping Git information collection.'); + } } catch (error) { core.warning('Failed while attempting to collect Git information: ' + error); } finally { From 94d6648c0b3924848a7e4e33205484d57948b263 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Thu, 8 Jan 2026 12:32:55 +0200 Subject: [PATCH 2/3] FF-000 - Set JFROG_CLI_AVOID_NEW_VERSION_WARNING to avoid GitHub API rate limits --- src/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.ts b/src/utils.ts index 91d2212ca..6d9726409 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -290,6 +290,7 @@ export class Utils { '*password*;*secret*;*key*;*token*;*auth*;JF_ARTIFACTORY_*;JF_ENV_*;JF_URL;JF_USER;JF_PASSWORD;JF_ACCESS_TOKEN', ); Utils.exportVariableIfNotSet('JFROG_CLI_OFFER_CONFIG', 'false'); + Utils.exportVariableIfNotSet('JFROG_CLI_AVOID_NEW_VERSION_WARNING', 'true'); Utils.exportVariableIfNotSet('CI', 'true'); Utils.exportVariableIfNotSet('JFROG_CLI_SOURCECODE_REPOSITORY', process.env.GITHUB_REPOSITORY ?? ''); Utils.exportVariableIfNotSet('JFROG_CLI_CI_JOB_ID', process.env.GITHUB_WORKFLOW ?? ''); From 2a4a37525631b910b23d6eb7092462705368398e Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Thu, 8 Jan 2026 12:33:42 +0200 Subject: [PATCH 3/3] Enhance Git information collection by checking for .git directory existence and set JFROG_CLI_AVOID_NEW_VERSION_WARNING to true --- lib/cleanup.js | 8 +++++++- lib/utils.js | 1 + src/utils.ts | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/cleanup.js b/lib/cleanup.js index 52fa3fbc9..adb012d2e 100644 --- a/lib/cleanup.js +++ b/lib/cleanup.js @@ -137,7 +137,13 @@ function collectAndPublishBuildInfoIfNeeded() { // We allow this step to fail, and we don't want to fail the entire build publish if they do. try { core.startGroup('Collect the Git information'); - yield utils_1.Utils.runCli(['rt', 'build-add-git'], { cwd: workingDirectory }); + const gitDir = require('path').join(workingDirectory, '.git'); + if (require('fs').existsSync(gitDir)) { + yield utils_1.Utils.runCli(['rt', 'build-add-git'], { cwd: workingDirectory }); + } + else { + core.info('No .git directory found. Skipping Git information collection.'); + } } catch (error) { core.warning('Failed while attempting to collect Git information: ' + error); diff --git a/lib/utils.js b/lib/utils.js index c5c6c42a7..1f9b70440 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -255,6 +255,7 @@ class Utils { } Utils.exportVariableIfNotSet('JFROG_CLI_ENV_EXCLUDE', '*password*;*secret*;*key*;*token*;*auth*;JF_ARTIFACTORY_*;JF_ENV_*;JF_URL;JF_USER;JF_PASSWORD;JF_ACCESS_TOKEN'); Utils.exportVariableIfNotSet('JFROG_CLI_OFFER_CONFIG', 'false'); + Utils.exportVariableIfNotSet('JFROG_CLI_AVOID_NEW_VERSION_WARNING', 'true'); Utils.exportVariableIfNotSet('CI', 'true'); Utils.exportVariableIfNotSet('JFROG_CLI_SOURCECODE_REPOSITORY', (_a = process.env.GITHUB_REPOSITORY) !== null && _a !== void 0 ? _a : ''); Utils.exportVariableIfNotSet('JFROG_CLI_CI_JOB_ID', (_b = process.env.GITHUB_WORKFLOW) !== null && _b !== void 0 ? _b : ''); diff --git a/src/utils.ts b/src/utils.ts index 6d9726409..ef4168309 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -480,8 +480,8 @@ export class Utils { if (!jfrogCredentials.jfrogUrl) { throw new Error( `'download-repository' input provided, but no JFrog environment details found. ` + - `Hint - Ensure that the JFrog connection details environment variables are set: ` + - `either a Config Token with a JF_ENV_ prefix or separate env config (JF_URL, JF_USER, JF_PASSWORD, JF_ACCESS_TOKEN)`, + `Hint - Ensure that the JFrog connection details environment variables are set: ` + + `either a Config Token with a JF_ENV_ prefix or separate env config (JF_URL, JF_USER, JF_PASSWORD, JF_ACCESS_TOKEN)`, ); } serverObj.artifactoryUrl = jfrogCredentials.jfrogUrl.replace(/\/$/, '') + '/artifactory';