@@ -50,42 +50,52 @@ jobs:
50
50
release :
51
51
runs-on : ubuntu-latest
52
52
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 }}
55
58
steps :
56
-
57
- # CHECKOUT PROJECT
58
59
- uses : actions/checkout@v4
59
60
with :
60
61
fetch-depth : 0
61
62
62
- # GIT CONFIGURATION
63
- - run : |
63
+ - name : Git Configuration
64
+ run : |
64
65
git config user.name github-actions
65
66
git config user.email [email protected]
66
67
67
- # SETUP NODE
68
68
69
69
with :
70
70
node-version : 22.11.0
71
71
registry-url : https://npm.pkg.github.com/
72
72
73
- # GET TAG NAME
74
73
- name : Generate Tag name
74
+ id : generate_tag_name
75
75
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)
78
78
else
79
- echo " TAG_NAME=$(npm version patch --no-git-tag-version)" >> $GITHUB_ENV
79
+ TAG_NAME=$(npm version patch --no-git-tag-version)
80
80
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"
81
93
82
- # RUN NPM INSTALL AND BUILD
83
94
- name : NPM ci and build
84
95
run : |
85
96
npm ci
86
97
npm run build
87
98
88
- # CREATE PR FOR VERSION
89
99
- name : Create Pull Request
90
100
id : create_pr
91
101
if : inputs.dev == false
@@ -98,32 +108,27 @@ jobs:
98
108
base : main
99
109
draft : false
100
110
101
- # WAIT FOR PR CREATION
102
111
- name : Wait for PR to be created
103
112
id : pr
104
113
if : inputs.dev == false
105
114
uses : octokit/request-action@872c5c97b3c85c23516a572f02b31401ef82415d # v2.3.1
106
115
with :
107
116
route : GET /repos/${{ github.repository }}/pulls?head=${{ github.repository_owner }}:${{ env.BRANCH_NAME }}
108
117
109
- # MERGE PR TO MAIN
110
118
- name : Merge Pull Request
111
119
if : inputs.dev == false
112
120
uses : octokit/request-action@872c5c97b3c85c23516a572f02b31401ef82415d # v2.3.1
113
121
with :
114
122
route : PUT /repos/${{ github.repository }}/pulls/${{ steps.create_pr.outputs.pull-request-number }}/merge
115
123
merge_method : squash
116
124
117
- # PUSH TAGS IF IT IS A RELEASE
118
125
- name : Push tag
119
126
if : inputs.dev == false
120
127
run : |
121
128
git pull
122
129
git tag ${{env.TAG_NAME}}
123
130
git push --tags
124
131
125
-
126
- # PUBLISH NPM PACKAGE
127
132
- name : Publish npm package
128
133
run : |
129
134
if [ ${{ inputs.dev }} == true ]; then
@@ -134,11 +139,23 @@ jobs:
134
139
env :
135
140
NODE_AUTH_TOKEN : ${{secrets.PERSONAL_ACCESS_TOKEN}}
136
141
137
- # CREATE RELEASE
138
142
- name : Create Release
139
143
uses : softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2
140
144
with :
141
145
name : ${{env.TAG_NAME}}
142
146
tag_name : ${{env.TAG_NAME}}
143
147
generate_release_notes : true
144
148
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