-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.23 KB
/
changeset.yml
File metadata and controls
42 lines (36 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Changeset Check
on:
pull_request:
branches:
- main
jobs:
changeset-check:
name: Check for Changeset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Check for changeset
run: |
# Skip changeset check for release PRs created by changesets/action
if [[ "${{ github.head_ref }}" == changeset-release/* ]] || [[ "${{ github.event.pull_request.title }}" == "chore: version packages" ]]; then
echo "⏭️ Skipping changeset check for release PR"
exit 0
fi
if [ -z "$(ls -A .changeset/*.md 2>/dev/null | grep -v README)" ]; then
echo "❌ No changeset found. Please add a changeset by running 'npm run changeset'"
echo ""
echo "Changesets help track version changes and generate changelogs."
echo "Run 'npm run changeset' and follow the prompts to create one."
exit 1
else
echo "✅ Changeset found"
fi