From 7aa5ea8287043fb7dd8d3ab5bce487914360b5a5 Mon Sep 17 00:00:00 2001 From: atishj99 Date: Tue, 11 Aug 2026 15:37:49 +0530 Subject: [PATCH 1/4] release workflow fix --- .github/workflows/delete-packages-and-releases.yml | 3 --- .github/workflows/nightly.yml | 1 - .github/workflows/release.yml | 4 ---- 3 files changed, 8 deletions(-) diff --git a/.github/workflows/delete-packages-and-releases.yml b/.github/workflows/delete-packages-and-releases.yml index 80ca0d8c..3d8cd83d 100644 --- a/.github/workflows/delete-packages-and-releases.yml +++ b/.github/workflows/delete-packages-and-releases.yml @@ -7,9 +7,6 @@ on: description: 'Tag to delete' required: true type: string - secrets: - GITHUB_TOKEN: - required: true workflow_dispatch: inputs: tag: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f0654a0e..ae89eff2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,5 +21,4 @@ jobs: packages: write # For publishing packages uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/release.yml@abe950ede3b052dfc236f730cf11cc290af53d1c secrets: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ECHO_LIBRARIES_ACCESS_KEY: ${{ secrets.ECHO_LIBRARIES_ACCESS_KEY }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eefbd17a..53f58f1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,6 @@ on: default: true type: boolean secrets: - GITHUB_TOKEN: - required: true ECHO_LIBRARIES_ACCESS_KEY: required: true workflow_dispatch: @@ -65,8 +63,6 @@ jobs: uses: Checkmarx/ast-cli-javascript-wrapper/.github/workflows/delete-packages-and-releases.yml@abe950ede3b052dfc236f730cf11cc290af53d1c with: tag: ${{ inputs.jsTag }} - secrets: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: inputs.dev == true release: name: Release JavaScript Wrapper From f23531e68386c13ae4d6536e88e7cd7927ea43d3 Mon Sep 17 00:00:00 2001 From: atishj99 Date: Tue, 11 Aug 2026 16:33:55 +0530 Subject: [PATCH 2/4] adding test coverage to 80%+ --- src/tests/LoggerConfigTest.test.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/tests/LoggerConfigTest.test.ts diff --git a/src/tests/LoggerConfigTest.test.ts b/src/tests/LoggerConfigTest.test.ts new file mode 100644 index 00000000..c3f4cd9b --- /dev/null +++ b/src/tests/LoggerConfigTest.test.ts @@ -0,0 +1,26 @@ +import { getLoggerWithFilePath, logger } from '../main/wrapper/loggerConfig'; +import * as fs from 'fs'; +import * as path from 'path'; + +describe('Logger Configuration', () => { + it('should initialize logger with file path', () => { + const tempDir = path.join(__dirname, '../../tmp'); + if (!fs.existsSync(tempDir)) { + fs.mkdirSync(tempDir, { recursive: true }); + } + + const logFilePath = path.join(tempDir, 'test.log'); + + // This should call configurationWithFile and cover line 4 + getLoggerWithFilePath(logFilePath); + + expect(logger).toBeDefined(); + }); + + it('should initialize logger without file path', () => { + // This should call configurationWithoutFile + getLoggerWithFilePath(); + + expect(logger).toBeDefined(); + }); +}); From 2096871d8ed489e3f939fe74fda2491ccf47e563 Mon Sep 17 00:00:00 2001 From: atishj99 Date: Tue, 11 Aug 2026 17:14:09 +0530 Subject: [PATCH 3/4] Enable authenticated tag push in release workflow Provide GITHUB_TOKEN and configure git user/email and url.insteadOf in the Push tag step. This allows the workflow to authenticate using the actions token and push tags when inputs.dev == false, avoiding interactive auth failures during tag creation and push. --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53f58f1b..2bf2d7f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -192,7 +192,12 @@ jobs: # PUSH TAGS IF IT IS A RELEASE - name: Push tag if: inputs.dev == false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + git config user.name github-actions + git config user.email github-actions@github.com + git config --global url."https://github-actions:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" git pull git tag ${TAG_NAME} git push --tags From 6fd0367985d0ab2369754e687dbad3e0b0d48dcc Mon Sep 17 00:00:00 2001 From: atishj99 Date: Tue, 11 Aug 2026 17:14:09 +0530 Subject: [PATCH 4/4] Enable authenticated tag push in release workflow Provide GITHUB_TOKEN and configure git user/email and url.insteadOf in the Push tag step. This allows the workflow to authenticate using the actions token and push tags when inputs.dev == false, avoiding interactive auth failures during tag creation and push. --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53f58f1b..2bf2d7f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -192,7 +192,12 @@ jobs: # PUSH TAGS IF IT IS A RELEASE - name: Push tag if: inputs.dev == false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + git config user.name github-actions + git config user.email github-actions@github.com + git config --global url."https://github-actions:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" git pull git tag ${TAG_NAME} git push --tags