diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 99065e9..f4dcded 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -28,3 +28,21 @@ jobs: if: runner.os == 'Linux' - run: npm test if: runner.os != 'Linux' + + check_version: + name: Check Version + runs-on: ubuntu-latest + outputs: + versionChanged: ${{ steps.step1.outputs}} + steps: + - name: Checkout + id: check_version + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: npm install + - run: ./scripts/check_version >> $GITHUB_OUTPUT + + - name: Is Version changed + id: "Changed" + run: echo ${{steps.check_version.outputs.versionChanged}} diff --git a/scripts/check_version b/scripts/check_version index f25232a..3c6b18a 100755 --- a/scripts/check_version +++ b/scripts/check_version @@ -19,11 +19,11 @@ const latest_tag_number = latest_tag.replace("v", ""); if (current_version > latest_tag_number) { process.exitCode = 0; process.stdout.write( - `Version Check successfull. Version will be changed to ${current_version}` + `true` ); } else { process.stderr.write( - `\nVersion in number in package.json should be higher than the latest version\nThe latest tagged version is ${latest_tag}\nCurrent version in package.json is ${current_version}` + `false` ); - process.exitCode = 1; + process.exitCode = 0; }