Skip to content

ci: 🎡 copy .releaserc.js file in dist folder for release #225

ci: 🎡 copy .releaserc.js file in dist folder for release

ci: 🎡 copy .releaserc.js file in dist folder for release #225

name: Develop Breaking Changes Check
on:
pull_request:
types: [assigned, opened, reopened, synchronize]
branches: [develop]
jobs:
check-breaking-changes:
# Skip this check for bc-* branches (they're meant for breaking changes)
if: ${{ !startsWith(github.head_ref, 'bc-') }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check commit messages for breaking changes
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
# Get all commits in the PR
commits=$(git rev-list $BASE_SHA..$HEAD_SHA)
# Check each commit for breaking changes
for commit in $commits; do
commit_msg=$(git show --pretty="format:%s" --no-patch $commit)
commit_body=$(git show --pretty="format:%b" --no-patch $commit)
# Check for breaking change indicators
if [[ "$commit_msg" == *"!"* ]] || [[ "$commit_body" == *"BREAKING CHANGE:"* ]]; then
echo "❌ Breaking change detected in commit $commit"
echo ""
echo "Breaking changes should not be merged directly to develop."
echo "Please create a breaking change branch instead:"
echo ""
echo "1. Create a new branch: bc-<number>-<description>"
echo "2. Cherry-pick or move your commits there"
echo "3. Push the bc-* branch"
echo "4. Breaking changes will be integrated in the next major release"
echo ""
echo "Example:"
echo " git checkout -b bc-1-remove-deprecated-api develop"
echo " git cherry-pick $commit"
echo " git push origin bc-1-remove-deprecated-api"
exit 1
fi
done
echo "✅ No breaking changes detected - safe to merge to develop"
# Keep existing check-api-snapshot job unchanged
check-api-snapshot:
name: Validate API snapshot
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch (e.g. feat branch)
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for full branch context
- name: Enable Corepack
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install dependencies
run: yarn install --immutable
# Build and snapshot current PR branch
- name: Build PR declaration files
run: yarn build:declaration-only
- name: Generate PR API snapshot
run: |
yarn api-snapshot:generate
mv api-snapshot.json pr-api-snapshot.json
# # Checkout and build develop snapshot
# - name: Stash changes
# run: git stash --include-untracked
- name: Checkout develop branch
run: git checkout origin/develop
- name: Install dependencies (develop)
run: yarn install --immutable
- name: Build develop declaration files
run: yarn build:declaration-only
- name: Generate develop API snapshot
run: |
yarn api-snapshot:generate
mv api-snapshot.json develop-api-snapshot.json
# Compare snapshots: develop vs PR
- name: Compare API snapshots
run: |
cp develop-api-snapshot.json base-api-snapshot.json
cp pr-api-snapshot.json current-api-snapshot.json
yarn api-snapshot:compare