Skip to content

GitHub templates

GitHub templates #9

Workflow file for this run

name: Check version bump
on:
pull_request:
branches: [main]
types: [opened, reopened, synchronize, ready_for_review]
jobs:
semver-check:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
- name: Fetch main branch
run: git fetch origin main
- name: Compare package.json versions
run: |
PR_VERSION=$(jq -r '.version' package.json)
MAIN_VERSION=$(git show origin/main:package.json | jq -r '.version')
echo "Main branch version: $MAIN_VERSION"
echo "PR branch version: $PR_VERSION"
if [ "$PR_VERSION" = "$MAIN_VERSION" ]; then
echo "❌ Version not updated!"
exit 1
else
echo "✅ Version updated."
fi