diff --git a/action.yml b/action.yml index 8214af951..7af7695eb 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,7 @@ author: "JFrog" inputs: version: description: "JFrog CLI Version" - default: "2.72.3" + default: "2.72.4" required: false download-repository: description: "Remote repository in Artifactory pointing to 'https://releases.jfrog.io/artifactory/jfrog-cli'. Use this parameter in case you don't have an Internet access." diff --git a/lib/utils.js b/lib/utils.js index a971d5778..8341b5eb5 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -821,7 +821,10 @@ class Utils { return Utils.getMarkdownHeader() + fileContent + Utils.getMarkdownFooter(); } static getMarkdownFooter() { - return '\n\n # \n\n The above Job Summary was generated by the Setup JFrog CLI GitHub Action '; + return `\n\n # \n\n ${this.getUsageBadge()} \n\n The above Job Summary was generated by the Setup JFrog CLI GitHub Action `; + } + static getUsageBadge() { + return `![](${process.env.JF_URL}/ui/api/v1/u?s=1&m=1&job_id=${process.env.GITHUB_JOB}&run_id=${process.env.GITHUB_RUN_ID}&git_repo=${process.env.GITHUB_REPOSITORY})`; } static isHeaderPngAccessible() { return __awaiter(this, void 0, void 0, function* () { diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 0b34c4962..8f497f3e2 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.3", + "version": "4.5.4", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index 4da702222..8b11e8d07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.3", + "version": "4.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.3", + "version": "4.5.4", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index c8563ae02..d03ef4ea0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jfrog/setup-jfrog-cli", - "version": "4.5.3", + "version": "4.5.4", "private": true, "description": "Setup JFrog CLI in GitHub Actions", "main": "lib/main.js", diff --git a/src/utils.ts b/src/utils.ts index 607a3e261..821f11562 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -520,9 +520,9 @@ export class Utils { Utils.enableJobSummaries(); } - Utils.setUsageEnvVars() + Utils.setUsageEnvVars(); } - + // Set usage variables to be captured by JFrog CLI visibility metric service. public static setUsageEnvVars(): void { // Set the GitHub repository name or default to an empty string. @@ -906,7 +906,11 @@ export class Utils { } private static getMarkdownFooter() { - return '\n\n # \n\n The above Job Summary was generated by the Setup JFrog CLI GitHub Action '; + return `\n\n # \n\n ${this.getUsageBadge()} \n\n The above Job Summary was generated by the Setup JFrog CLI GitHub Action `; + } + + private static getUsageBadge(): string { + return `![](${process.env.JF_URL}/ui/api/v1/u?s=1&m=1&job_id=${process.env.GITHUB_JOB}&run_id=${process.env.GITHUB_RUN_ID}&git_repo=${process.env.GITHUB_REPOSITORY})`; } private static async isHeaderPngAccessible(): Promise { diff --git a/test/main.spec.ts b/test/main.spec.ts index 0ebea0313..c96f29857 100644 --- a/test/main.spec.ts +++ b/test/main.spec.ts @@ -472,7 +472,6 @@ describe('Utils.removeJFrogServers', () => { }); }); - describe('getApplicationKey', () => { const mockReadFile: jest.Mock = fs.promises.readFile as jest.Mock; const mockExistsSync: jest.Mock = fs.existsSync as jest.Mock; @@ -568,4 +567,3 @@ describe('setUsageEnvVars', () => { expect(core.exportVariable).toHaveBeenCalledWith('JFROG_CLI_USAGE_GH_TOKEN_FOR_CODE_SCANNING_ALERTS_PROVIDED', false); }); }); -