File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1-
21name : Javascript Wrapper Release
32
43on :
9190 echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
9291 echo "::set-output name=CLI_VERSION::$CLI_VERSION"
9392
93+ - name : Check if CLI version is latest
94+ id : check_latest_cli_version
95+ run : |
96+ API_RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/Checkmarx/ast-cli/releases/latest)
97+ LATEST_CLI_VERSION=$(echo "$API_RESPONSE" | grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)"/\1/' | sed 's/^v//')
98+
99+ if [ "$CLI_VERSION" = "$LATEST_CLI_VERSION" ]; then
100+ echo "Confirm that the CLI version in the repository is up-to-date with the most recent release: $CLI_VERSION"
101+ else
102+ echo "The current repository contains a CLI version that differs from the latest released version: Expected $LATEST_CLI_VERSION, got $CLI_VERSION"
103+ exit 1
104+ fi
105+
94106 - name : NPM ci and build
95107 run : |
96108 npm ci
You can’t perform that action at this time.
0 commit comments