fix app deployment #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |