Skip to content

Commit c88b5c6

Browse files
authored
Fix Changeset Test (RooCodeInc#1657)
* should only pass if the PR has a new changeset * improvements to docs-only check * add changeset
1 parent 1935aab commit c88b5c6

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
Fix a bug where we were not properly checking for changesets in check-changeset git action

.github/workflows/check-changeset.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,43 +40,41 @@ jobs:
4040
echo "Changed files:"
4141
echo "$CHANGED_FILES"
4242
43-
echo "Listing .changeset directory:"
44-
ls -la .changeset/
45-
4643
# Check if any of the changed files are in docs/ or .github/
44+
echo "Checking if changes are docs-only..."
4745
DOCS_ONLY=true
4846
while IFS= read -r file; do
4947
if [[ ! "$file" =~ ^(docs/|.github/) ]]; then
48+
echo "Found non-docs change: $file"
5049
DOCS_ONLY=false
5150
break
5251
fi
5352
done <<< "$CHANGED_FILES"
5453
5554
# If changes are docs-only, skip changeset check
5655
if [ "$DOCS_ONLY" = true ]; then
57-
echo "Only documentation files were changed, skipping changeset check"
56+
echo "All changes are in docs/ or .github/, skipping changeset check"
5857
exit 0
58+
else
59+
echo "Changes include non-docs files, checking for changeset..."
5960
fi
6061
6162
# Check if any changeset files are in the changed files
63+
echo "Checking for changeset files in changed files..."
6264
CHANGESET_IN_PR=false
6365
while IFS= read -r file; do
64-
if [[ "$file" =~ ^\.changeset/.*\.md$ && "$file" != ".changeset/README.md" ]]; then
66+
if [[ "$file" =~ ^\.changeset/.*\.md$ && "$file" != ".changeset/README.md" && "$file" != ".changeset/config.json" ]]; then
6567
echo "Found changeset file in PR: $file"
6668
CHANGESET_IN_PR=true
6769
break
6870
fi
6971
done <<< "$CHANGED_FILES"
7072
7173
if [ "$CHANGESET_IN_PR" = false ]; then
72-
# Double check local changeset files as backup
73-
CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ')
74-
echo "Number of local changesets: $CHANGESETS"
75-
76-
if [ "$CHANGESETS" -eq 0 ]; then
77-
echo "::error::No changeset file found in PR changes or local directory. Please run 'npm run changeset' to create one."
78-
exit 1
79-
fi
74+
echo "No changeset files found in changed files. Changed files in .changeset/:"
75+
echo "$CHANGED_FILES" | grep "^\.changeset/" || true
76+
echo "::error::No changeset file found in PR changes. Please run 'npm run changeset' to create one."
77+
exit 1
8078
fi
8179
8280
- name: Comment on PR

0 commit comments

Comments
 (0)