Skip to content

Commit

Permalink
check: version test
Browse files Browse the repository at this point in the history
  • Loading branch information
Viijay-Kr committed Jan 8, 2024
1 parent 9323b42 commit 7409632
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
6 changes: 3 additions & 3 deletions scripts/check_version
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7409632

Please sign in to comment.