Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro100 committed Apr 22, 2024
1 parent 2fcbf82 commit 7f44368
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/typescript_pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,21 @@ jobs:
with:
ref: master

- name: Get current local version
id: get_current_local_version
run: echo "version=$(jq -r '.version' models/typescript/package.json)" >> $GITHUB_OUTPUT

- name: Get version on master
id: get_master_version
run: echo "master-version=$(jq -r '.version' jq -r '.version' master/models/typescript/package.json)" >> $GITHUB_OUTPUT
- name: Get package.json from master
run: |
git fetch origin master
git checkout origin/master -- models/typescript/package.json
mv models/typescript/package.json master_package.json
- name: Compare versions
- name: Compare package.json
run: |
current_version="${{ steps.get_current_local_version.outputs.version }}"
master_version="${{ steps.get_master_version.outputs.master-version }}"
if [ "$current_version" != "$master_version" ]; then
echo "Versions are different:"
echo "Current version: $current_version"
echo "Version on master: $master_version"
diff=$(jq -sS --exit-status '.[0] == .[1]' models/typescript/package.json master_package.json || echo "different")
if [ "$diff" == "different" ]; then
echo "Package.json files are different"
# You can take appropriate actions here
else
echo "Versions are the same: $current_version"
echo "Please update the package.json version so that your changes will be published."
exit 1
echo "Package.json files are the same"
echo "Please update the package.json version so that your changes will be published."
exit 1
fi

0 comments on commit 7f44368

Please sign in to comment.