Skip to content

Commit 7af9b7e

Browse files
Copilothotlong
andcommitted
Add changeset check workflow and update documentation
- Create changeset-check.yml workflow to verify PRs include changesets - Update .github/WORKFLOWS.md with changeset check documentation - Add skip-changeset label support for PRs that don't need changesets Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent a7a47e8 commit 7af9b7e

File tree

2 files changed

+87
-3
lines changed

2 files changed

+87
-3
lines changed

.github/WORKFLOWS.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,34 @@ graph LR
172172

173173
**Note**: See [CONTRIBUTING.md](../CONTRIBUTING.md#versioning-and-releases) for details on creating changesets.
174174

175-
### 9. Stale Issues & PRs
175+
### 9. Changeset Check
176+
177+
**File**: `changeset-check.yml`
178+
**Triggers**: Pull Requests (opened, synchronized, labeled)
179+
180+
Ensures PRs that modify packages include a changeset.
181+
182+
**What It Does**:
183+
- Checks if PR modifies any files in `packages/`
184+
- Verifies a changeset file exists (`.changeset/*.md`)
185+
- Fails the check if changeset is missing
186+
- Can be skipped with `skip-changeset` or `dependencies` label
187+
188+
**When to Skip**:
189+
- Documentation-only changes
190+
- Changes to examples or apps
191+
- Test-only updates
192+
- Automated dependency updates (Dependabot)
193+
194+
**How to Pass**:
195+
1. Run `pnpm changeset` locally
196+
2. Follow the prompts to create a changeset
197+
3. Commit the generated `.changeset/*.md` file
198+
4. OR add `skip-changeset` label if not needed
199+
200+
This workflow helps maintain consistent versioning and comprehensive changelogs.
201+
202+
### 10. Stale Issues & PRs
176203

177204
**File**: `stale.yml`
178205
**Triggers**: Daily schedule, Manual workflow dispatch
@@ -185,7 +212,7 @@ Manages stale issues and pull requests.
185212
- Exempt labels: `pinned`, `security`, `critical`, `bug`, `enhancement`
186213
- Can be reopened if activity resumes
187214

188-
### 10. Dependabot Auto-merge
215+
### 11. Dependabot Auto-merge
189216

190217
**File**: `dependabot-auto-merge.yml`
191218
**Configuration**: `dependabot.yml`
@@ -204,7 +231,7 @@ Automatically manages dependency updates.
204231
- Groups related dependencies
205232
- Limits to 10 open PRs
206233

207-
### 11. Auto Changelog
234+
### 12. Auto Changelog
208235

209236
**File**: `changelog.yml`
210237
**Triggers**: Release published, Manual workflow dispatch
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Changeset Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled, unlabeled]
6+
7+
jobs:
8+
check:
9+
name: Check for Changeset
10+
runs-on: ubuntu-latest
11+
# Skip this check if PR has 'skip-changeset' label or only changes non-package files
12+
if: |
13+
!contains(github.event.pull_request.labels.*.name, 'skip-changeset') &&
14+
!contains(github.event.pull_request.labels.*.name, 'dependencies')
15+
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 9
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20.x'
31+
cache: 'pnpm'
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Check for changesets
37+
run: |
38+
# Check if there are any changesets
39+
if [ ! "$(ls -A .changeset/*.md 2>/dev/null | grep -v 'README.md')" ]; then
40+
# Check if any package files were changed
41+
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q '^packages/'; then
42+
echo "❌ This PR modifies packages but doesn't include a changeset"
43+
echo ""
44+
echo "To add a changeset, run: pnpm changeset"
45+
echo ""
46+
echo "If this PR doesn't need a changeset (docs only, etc.),"
47+
echo "add the 'skip-changeset' label to the PR"
48+
echo ""
49+
echo "📚 Learn more: https://github.com/objectstack-ai/objectui/blob/main/CONTRIBUTING.md#versioning-and-releases"
50+
exit 1
51+
else
52+
echo "✅ No package changes detected, skipping changeset check"
53+
fi
54+
else
55+
echo "✅ Changeset found"
56+
fi
57+

0 commit comments

Comments
 (0)