Sources #59
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Changeset Check | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| check: | |
| name: Check for changeset | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.3 | |
| - 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 if Twister or tools were modified | |
| id: check-changes | |
| run: | | |
| # Get list of changed files | |
| git fetch origin main | |
| CHANGED_FILES=$(git diff --name-only origin/main...HEAD) | |
| # Check if Twister was modified (sources are private and don't need changesets) | |
| TWISTER_CHANGED=$(echo "$CHANGED_FILES" | grep -E '^twister/' || true) | |
| if [ -n "$TWISTER_CHANGED" ]; then | |
| echo "needs-changeset=true" >> $GITHUB_OUTPUT | |
| echo "Twister package was modified" | |
| else | |
| echo "needs-changeset=false" >> $GITHUB_OUTPUT | |
| echo "No Twister changes detected" | |
| fi | |
| - name: Check for changesets | |
| if: steps.check-changes.outputs.needs-changeset == 'true' | |
| run: | | |
| # Check if there are any changeset files (excluding README.md and config.json) | |
| CHANGESET_COUNT=$(ls -1 .changeset/*.md 2>/dev/null | grep -v README.md | wc -l | tr -d ' ') | |
| if [ "$CHANGESET_COUNT" -eq 0 ]; then | |
| echo "❌ Error: Changes detected in Twister package, but no changeset found." | |
| echo "" | |
| echo "Please add a changeset by running:" | |
| echo " pnpm changeset" | |
| echo "" | |
| echo "This helps maintain proper versioning and changelogs." | |
| exit 1 | |
| else | |
| echo "✅ Changeset found (count: $CHANGESET_COUNT)" | |
| fi | |
| - name: Validate changeset format | |
| run: pnpm validate-changesets |