Skip to content

fix Deployment

fix Deployment #5

Workflow file for this run

name: Check NPM Version Bump
on: pull_request
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensures full git history
- name: Get base branch package.json version
run: echo "OLD_VERSION=$(git show origin/${{ github.base_ref }}:package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Get PR package.json version
run: echo "NEW_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
- name: Compare versions
run: |
if [ "$OLD_VERSION" == "$NEW_VERSION" ]; then
echo "package.json version has not changed. Please bump the version."
exit 1
fi
env:
OLD_VERSION: ${{ env.OLD_VERSION }}
NEW_VERSION: ${{ env.NEW_VERSION }}