@@ -50,42 +50,52 @@ jobs:
5050 release :
5151 runs-on : ubuntu-latest
5252 env :
53- GITHUB_TOKEN : ${{ secrets.OR_GITHUB_TOKEN }}
54- BRANCH_NAME : npm-version-patch
53+ GITHUB_TOKEN : ${{ secrets.OR_GITHUB_TOKEN }}
54+ BRANCH_NAME : npm-version-patch
55+ outputs :
56+ TAG_NAME : ${{ steps.generate_tag_name.outputs.TAG_NAME }}
57+ CLI_VERSION : ${{ steps.extract_cli_version.outputs.CLI_VERSION }}
5558 steps :
56-
57- # CHECKOUT PROJECT
5859 - uses : actions/checkout@v4
5960 with :
6061 fetch-depth : 0
6162
62- # GIT CONFIGURATION
63- - run : |
63+ - name : Git Configuration
64+ run : |
6465 git config user.name github-actions
6566 git config user.email [email protected] 6667
67- # SETUP NODE
68686969 with :
7070 node-version : 22.11.0
7171 registry-url : https://npm.pkg.github.com/
7272
73- # GET TAG NAME
7473 - name : Generate Tag name
74+ id : generate_tag_name
7575 run : |
76- if [ ${{ inputs.dev }} == true ]; then
77- echo " TAG_NAME=$(npm version prerelease --preid=${{ inputs.jsTag }} --no-git-tag-version --allow-same-version)" >> $GITHUB_ENV
76+ if [ " ${{ inputs.dev }}" == " true" ]; then
77+ TAG_NAME=$(npm version prerelease --preid=${{ inputs.jsTag }} --no-git-tag-version --allow-same-version)
7878 else
79- echo " TAG_NAME=$(npm version patch --no-git-tag-version)" >> $GITHUB_ENV
79+ TAG_NAME=$(npm version patch --no-git-tag-version)
8080 fi
81+
82+ echo "Generated TAG_NAME: $TAG_NAME"
83+ echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
84+ echo "::set-output name=TAG_NAME::$TAG_NAME"
85+
86+ - name : Extract CLI version
87+ id : extract_cli_version
88+ run : |
89+ CLI_VERSION=$(cat checkmarx-ast-cli.version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+')
90+ echo "CLI version being packed is $CLI_VERSION"
91+ echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
92+ echo "::set-output name=CLI_VERSION::$CLI_VERSION"
8193
82- # RUN NPM INSTALL AND BUILD
8394 - name : NPM ci and build
8495 run : |
8596 npm ci
8697 npm run build
8798
88- # CREATE PR FOR VERSION
8999 - name : Create Pull Request
90100 id : create_pr
91101 if : inputs.dev == false
@@ -98,32 +108,27 @@ jobs:
98108 base : main
99109 draft : false
100110
101- # WAIT FOR PR CREATION
102111 - name : Wait for PR to be created
103112 id : pr
104113 if : inputs.dev == false
105114 uses : octokit/request-action@872c5c97b3c85c23516a572f02b31401ef82415d # v2.3.1
106115 with :
107116 route : GET /repos/${{ github.repository }}/pulls?head=${{ github.repository_owner }}:${{ env.BRANCH_NAME }}
108117
109- # MERGE PR TO MAIN
110118 - name : Merge Pull Request
111119 if : inputs.dev == false
112120 uses : octokit/request-action@872c5c97b3c85c23516a572f02b31401ef82415d # v2.3.1
113121 with :
114122 route : PUT /repos/${{ github.repository }}/pulls/${{ steps.create_pr.outputs.pull-request-number }}/merge
115123 merge_method : squash
116124
117- # PUSH TAGS IF IT IS A RELEASE
118125 - name : Push tag
119126 if : inputs.dev == false
120127 run : |
121128 git pull
122129 git tag ${{env.TAG_NAME}}
123130 git push --tags
124131
125-
126- # PUBLISH NPM PACKAGE
127132 - name : Publish npm package
128133 run : |
129134 if [ ${{ inputs.dev }} == true ]; then
@@ -134,11 +139,23 @@ jobs:
134139 env :
135140 NODE_AUTH_TOKEN : ${{secrets.PERSONAL_ACCESS_TOKEN}}
136141
137- # CREATE RELEASE
138142 - name : Create Release
139143 uses : softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2
140144 with :
141145 name : ${{env.TAG_NAME}}
142146 tag_name : ${{env.TAG_NAME}}
143147 generate_release_notes : true
144148 prerelease : ${{ inputs.dev }}
149+
150+ notify :
151+ if : inputs.dev == false
152+ needs : release
153+ uses : Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main
154+ with :
155+ product_name : Javascript Runtime Wrapper
156+ release_version : ${{ needs.release.outputs.TAG_NAME }}
157+ cli_release_version : ${{ needs.release.outputs.CLI_VERSION }}
158+ release_author : " Phoenix Team"
159+ release_url : https://github.com/CheckmarxDev/ast-cli-javascript-wrapper-runtime-cli/releases/tag/${{ needs.release.outputs.TAG_NAME }}
160+ jira_product_name : JS_RUNTIME_WRAPPER
161+ secrets : inherit
0 commit comments