Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
required: false
default: true
type: boolean
bumpVersion:
description: 'Bump npm version, create and merge version PR'
required: false
default: true
type: boolean
workflow_dispatch:
inputs:
cliTag:
Expand All @@ -33,6 +38,11 @@ on:
required: false
default: true
type: boolean
bumpVersion:
description: 'Bump npm version, create and merge version PR'
required: false
default: true
type: boolean

permissions:
contents: read
Expand Down Expand Up @@ -84,11 +94,14 @@ jobs:
env:
INPUT_DEV: ${{ inputs.dev }}
INPUT_JS_TAG: ${{ inputs.jsTag }}
INPUT_BUMP_VERSION: ${{ inputs.bumpVersion }}
run: |
if [ "$INPUT_DEV" == "true" ]; then
TAG_NAME=$(npm version prerelease --preid="$INPUT_JS_TAG" --no-git-tag-version --allow-same-version)
else
elif [ "$INPUT_BUMP_VERSION" == "true" ]; then
TAG_NAME=$(npm version patch --no-git-tag-version)
else
TAG_NAME=v$(node -p "require('./package.json').version")
fi
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -120,7 +133,7 @@ jobs:
# CREATE PR FOR VERSION
- name: Create Pull Request
id: create_pr
if: inputs.dev == false
if: inputs.dev == false && inputs.bumpVersion == true
uses: step-security/create-pull-request@50c103da2b9ca12cd5bc013fc6931051a5aa872b # v8.1.1
with:
token: ${{ env.GITHUB_TOKEN }}
Expand All @@ -133,14 +146,14 @@ jobs:
# WAIT FOR PR CREATION
- name: Wait for PR to be created
id: pr
if: inputs.dev == false
if: inputs.dev == false && inputs.bumpVersion == true
uses: octokit/request-action@b91aabaa861c777dcdb14e2387e30eddf04619ae # v3.0.0
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
if: inputs.dev == false && inputs.bumpVersion == true
uses: octokit/request-action@b91aabaa861c777dcdb14e2387e30eddf04619ae # v3.0.0
with:
route: PUT /repos/${{ github.repository }}/pulls/${{ steps.create_pr.outputs.pull-request-number }}/merge
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@Checkmarx/ast-cli-javascript-wrapper",
"version": "0.0.155",
"version": "0.0.156",
"description": "AST CLI Javascript wrapper",
"main": "dist/main/wrapper/CxWrapper.js",
"typings": "dist/main/wrapper/CxWrapper.d.ts",
Expand Down Expand Up @@ -51,4 +51,4 @@
"publishConfig": {
"registry": "https://npm.pkg.github.com"
}
}
}
Loading