From 2bcc0bd699c46e87d34aefd92f03139bc3a9d134 Mon Sep 17 00:00:00 2001 From: greensd4 <33864348+greensd4@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:12:00 +0200 Subject: [PATCH 1/5] Add release notify step (AST-000) --- .github/workflows/release.yml | 48 +++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15a4a0bd..a907f05f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,42 +50,51 @@ jobs: release: runs-on: ubuntu-latest env: - GITHUB_TOKEN: ${{ secrets.OR_GITHUB_TOKEN }} - BRANCH_NAME: npm-version-patch + GITHUB_TOKEN: ${{ secrets.OR_GITHUB_TOKEN }} + BRANCH_NAME: npm-version-patch + outputs: + TAG_NAME: ${{ steps.generate_tag_name.outputs.TAG_NAME }} + CLI_VERSION: ${{ steps.extract_cli_version.outputs.CLI_VERSION }} steps: - - # CHECKOUT PROJECT - uses: actions/checkout@v4 with: fetch-depth: 0 - # GIT CONFIGURATION - - run: | + - name: Git Configuration + run: | git config user.name github-actions git config user.email github-actions@github.com - # SETUP NODE - uses: actions/setup-node@v4.0.2 with: node-version: 22.11.0 registry-url: https://npm.pkg.github.com/ - # GET TAG NAME - name: Generate Tag name + id: generate_tag_name run: | if [ ${{ inputs.dev }} == true ]; then echo "TAG_NAME=$(npm version prerelease --preid=${{ inputs.jsTag }} --no-git-tag-version --allow-same-version)" >> $GITHUB_ENV else echo "TAG_NAME=$(npm version patch --no-git-tag-version)" >> $GITHUB_ENV fi + echo "Generated TAG_NAME: $TAG_NAME" + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV + echo "::set-output name=TAG_NAME::$TAG_NAME" + + - name: Extract CLI version + id: extract_cli_version + run: | + CLI_VERSION=$(cat checkmarx-ast-cli.version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+') + echo "CLI version being packed is $CLI_VERSION" + echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV + echo "::set-output name=CLI_VERSION::$CLI_VERSION" - # RUN NPM INSTALL AND BUILD - name: NPM ci and build run: | npm ci npm run build - # CREATE PR FOR VERSION - name: Create Pull Request id: create_pr if: inputs.dev == false @@ -98,7 +107,6 @@ jobs: base: main draft: false - # WAIT FOR PR CREATION - name: Wait for PR to be created id: pr if: inputs.dev == false @@ -106,7 +114,6 @@ jobs: with: route: GET /repos/${{ github.repository }}/pulls?head=${{ github.repository_owner }}:${{ env.BRANCH_NAME }} - # MERGE PR TO MAIN - name: Merge Pull Request if: inputs.dev == false uses: octokit/request-action@872c5c97b3c85c23516a572f02b31401ef82415d #v2.3.1 @@ -114,7 +121,6 @@ jobs: route: PUT /repos/${{ github.repository }}/pulls/${{ steps.create_pr.outputs.pull-request-number }}/merge merge_method: squash - # PUSH TAGS IF IT IS A RELEASE - name: Push tag if: inputs.dev == false run: | @@ -122,8 +128,6 @@ jobs: git tag ${{env.TAG_NAME}} git push --tags - - # PUBLISH NPM PACKAGE - name: Publish npm package run: | if [ ${{ inputs.dev }} == true ]; then @@ -134,7 +138,6 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}} - # CREATE RELEASE - name: Create Release uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 #v2 with: @@ -142,3 +145,16 @@ jobs: tag_name: ${{env.TAG_NAME}} generate_release_notes: true prerelease: ${{ inputs.dev }} + + notify: + if: inputs.dev == false || inputs.cliTag == '4.4.4' + needs: release + uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main + with: + product_name: Javascript Runtime Wrapper + release_version: ${{ needs.release.outputs.TAG_NAME }} + cli_release_version: ${{ needs.release.outputs.CLI_VERSION }} + release_author: "Phoenix Team" + release_url: https://github.com/CheckmarxDev/ast-cli-javascript-wrapper-runtime-cli/releases/tag/${{ needs.release.outputs.TAG_NAME }} + jira_product_name: JS_RUNTIME_WRAPPER + secrets: inherit \ No newline at end of file From 2f1f07164911a9367a2a5fe0267ea035d4ff327d Mon Sep 17 00:00:00 2001 From: greensd4 <33864348+greensd4@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:13:12 +0200 Subject: [PATCH 2/5] commit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a907f05f..39e6835a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,7 +147,7 @@ jobs: prerelease: ${{ inputs.dev }} notify: - if: inputs.dev == false || inputs.cliTag == '4.4.4' + if: inputs.dev == false || inputs.cliTag == '2.3.12' needs: release uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main with: From b2855537d4953e7f32b2b93ea91e1f16f0d12366 Mon Sep 17 00:00:00 2001 From: greensd4 <33864348+greensd4@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:17:40 +0200 Subject: [PATCH 3/5] tag --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39e6835a..e7ed5362 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,11 +73,12 @@ jobs: - name: Generate Tag name id: generate_tag_name run: | - if [ ${{ inputs.dev }} == true ]; then - echo "TAG_NAME=$(npm version prerelease --preid=${{ inputs.jsTag }} --no-git-tag-version --allow-same-version)" >> $GITHUB_ENV + if [ "${{ inputs.dev }}" == "true" ]; then + TAG_NAME=$(npm version prerelease --preid=${{ inputs.jsTag }} --no-git-tag-version --allow-same-version) else - echo "TAG_NAME=$(npm version patch --no-git-tag-version)" >> $GITHUB_ENV + TAG_NAME=$(npm version patch --no-git-tag-version) fi + echo "Generated TAG_NAME: $TAG_NAME" echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV echo "::set-output name=TAG_NAME::$TAG_NAME" From 23f8bfdb58666b8d312e82aac3d5fbd6bc3ed566 Mon Sep 17 00:00:00 2001 From: greensd4 <33864348+greensd4@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:24:32 +0200 Subject: [PATCH 4/5] commit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7ed5362..1aebbf25 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,7 +148,7 @@ jobs: prerelease: ${{ inputs.dev }} notify: - if: inputs.dev == false || inputs.cliTag == '2.3.12' + if: inputs.dev == false needs: release uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main with: From 4087bbd68e18a8f9bb8f17728c805316a8ec4662 Mon Sep 17 00:00:00 2001 From: greensd4 <33864348+greensd4@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:02:58 +0200 Subject: [PATCH 5/5] u[date tests threshold --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 8c7977c5..27a047a2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -44,7 +44,7 @@ module.exports = { collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'], coverageThreshold: { "global": { - "branches": 65, + "branches": 60, "functions": 80, "lines": 80, "statements": 80