Skip to content
name: GBFS Typescript Language Bindings - PR Check
on:
push:
branches:
- feat/publish-gbfs-language-binding-workflow
pull_request:
branches:
- main
paths:
- "models/typescript/**"
jobs:
check-versions:
name: check-version-job
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: master
- 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 package.json
run: |
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 "Package.json files are the same"
echo "Please update the package.json version so that your changes will be published."
exit 1
fi