Skip to content

chore(deps): bump @types/node from 20.19.22 to 24.9.1 #5

chore(deps): bump @types/node from 20.19.22 to 24.9.1

chore(deps): bump @types/node from 20.19.22 to 24.9.1 #5

name: Changeset Check
on:
pull_request:
types: [opened, synchronize]
jobs:
changeset-check:
name: Check for Changeset
runs-on: ubuntu-latest
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.user.login != 'github-actions[bot]'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check for code changes
id: code-changes
run: |
# Get list of changed files
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD)
# Check if any code files were changed (not just docs/config)
CODE_CHANGED=false
for file in $CHANGED_FILES; do
# Check if file is a code file (not docs, config, or github workflows)
if [[ "$file" =~ \.(ts|tsx|js|jsx)$ ]] && [[ ! "$file" =~ ^\.github/ ]] && [[ ! "$file" =~ \.(md|mdx)$ ]]; then
CODE_CHANGED=true
break
fi
done
echo "code_changed=$CODE_CHANGED" >> $GITHUB_OUTPUT
- name: Check for changeset
if: steps.code-changes.outputs.code_changed == 'true'
run: |
pnpm changeset status --since=origin/${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR if changeset is missing
if: failure() && steps.code-changes.outputs.code_changed == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const body = `## 📝 Changeset Required
This PR includes code changes but is missing a changeset. Changesets help us:
- Track changes for release notes
- Determine version bumps (patch/minor/major)
- Credit contributors properly
### How to add a changeset:
1. Run \`pnpm changeset\` in your local environment
2. Select the type of change (patch/minor/major)
3. Write a brief description of your changes
4. Commit the generated changeset file
### Change types:
- **patch**: Bug fixes, internal changes (0.0.X)
- **minor**: New features, non-breaking changes (0.X.0)
- **major**: Breaking changes (X.0.0)
### Example:
\`\`\`bash
$ pnpm changeset
? What kind of change is this? › patch
? Summary › Fixed TypeScript types for ArticleJsonLd component
\`\`\`
If this PR only contains documentation or non-code changes, you can ignore this message.`;
// Check if we already commented
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const hasComment = comments.data.some(comment =>
comment.body.includes('## 📝 Changeset Required')
);
if (!hasComment) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}
- name: Skip message for non-code changes
if: steps.code-changes.outputs.code_changed == 'false'
run: echo "No code changes detected, changeset not required."