Skip to content
Merged
Changes from 3 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
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Javascript Wrapper Release

on:
Expand Down Expand Up @@ -91,6 +90,19 @@ jobs:
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
echo "::set-output name=CLI_VERSION::$CLI_VERSION"

- name: Check if CLI version is latest
id: check_latest_cli_version
run: |
API_RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/Checkmarx/ast-cli/releases/latest)
LATEST_CLI_VERSION=$(echo "$API_RESPONSE" | grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)"/\1/' | sed 's/^v//')

if [ "$CLI_VERSION" = "$LATEST_CLI_VERSION" ]; then
echo "Confirm that the CLI version in the repository is up-to-date with the most recent release: $CLI_VERSION"
else
echo "The current repository contains a CLI version that differs from the latest released version: Expected $LATEST_CLI_VERSION, got $CLI_VERSION"
exit 1
fi

- name: NPM ci and build
run: |
npm ci
Expand Down
Loading