chore(deps): update vite to v8 #274
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: | |
| types: [opened, reopened, synchronize, labeled, unlabeled] | |
| permissions: | |
| pull-requests: read | |
| contents: read | |
| packages: read | |
| jobs: | |
| check: | |
| name: Check for Changeset | |
| runs-on: arc-happyvertical | |
| steps: | |
| - name: Generate GitHub App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3 | |
| with: | |
| app-id: ${{ secrets.HAVE_RELEASE_APP_ID }} | |
| private-key: ${{ secrets.HAVE_RELEASE_APP_PRIVATE_KEY }} | |
| owner: happyvertical | |
| continue-on-error: true | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://npm.pkg.github.com' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check for changeset | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Skip if PR has 'skip-changeset' label | |
| PR_NUM="${{ github.event.pull_request.number }}" | |
| if gh pr view "$PR_NUM" --json labels \ | |
| --jq '.labels[].name' | grep -q 'skip-changeset'; then | |
| echo "Skipping changeset check (skip-changeset label present)" | |
| exit 0 | |
| fi | |
| # Skip if PR is from changeset-release branch (automated version packages PR) | |
| PR_BRANCH="${{ github.event.pull_request.head.ref }}" | |
| if echo "$PR_BRANCH" | grep -q '^changeset-release/'; then | |
| echo "Skipping changeset check (changesets release PR from $PR_BRANCH)" | |
| exit 0 | |
| fi | |
| # Skip if PR is from renovate bot (automated dependency update PR) | |
| if echo "$PR_BRANCH" | grep -q '^renovate/'; then | |
| echo "Skipping changeset check (Renovate dependency update PR from $PR_BRANCH)" | |
| exit 0 | |
| fi | |
| # Skip if PR title starts with 'chore: version packages' or 'chore(release):' | |
| PR_TITLE="${{ github.event.pull_request.title }}" | |
| if echo "$PR_TITLE" | grep -qiE '^chore(\(release\))?:.*version'; then | |
| echo "Skipping changeset check (version packages PR)" | |
| exit 0 | |
| fi | |
| # Check if PR has conventional commits that will trigger auto-changeset | |
| echo "" | |
| echo "Checking for conventional commits..." | |
| # Get commits in this PR | |
| BASE_SHA="${{ github.event.pull_request.base.sha }}" | |
| HEAD_SHA="${{ github.event.pull_request.head.sha }}" | |
| # Check for releaseable conventional commits (feat, fix, perf, breaking changes) | |
| RELEASEABLE_COMMITS=$(git log \ | |
| $BASE_SHA..$HEAD_SHA --pretty=format:"%s" --no-merges | \ | |
| grep -E '^(feat|fix|perf)(\(.+\))?!?:|BREAKING CHANGE' \ | |
| || true) | |
| if [ -n "$RELEASEABLE_COMMITS" ]; then | |
| echo "Found conventional commits that will trigger auto-changeset on merge:" | |
| echo "$RELEASEABLE_COMMITS" | |
| echo "" | |
| echo "Validating changeset:auto script can generate changesets..." | |
| # Run changeset:auto to validate it works (don't commit the result) | |
| if pnpm run changeset:auto; then | |
| echo "changeset:auto validation passed" | |
| echo "" | |
| echo "Generated changesets will be created automatically when this PR merges to main." | |
| exit 0 | |
| else | |
| echo "ERROR: changeset:auto script failed" | |
| echo "" | |
| echo "The auto-changeset generation script encountered an error." | |
| echo "Please check the script or add a manual changeset." | |
| exit 1 | |
| fi | |
| fi | |
| echo "No releaseable conventional commits found (feat, fix, perf, or breaking changes)" | |
| echo "" | |
| # Check if changeset files exist (excluding README.md) | |
| changeset_count=$(find .changeset -name '*.md' ! -name 'README.md' 2>/dev/null | wc -l) | |
| if [ "$changeset_count" -eq 0 ]; then | |
| echo "No changeset found" | |
| echo "" | |
| echo "Please add a changeset by running:" | |
| echo " npx changeset" | |
| echo "" | |
| echo "Or add the 'skip-changeset' label if this PR doesn't require a version bump" | |
| echo "(e.g., documentation changes, test updates, workflow changes)" | |
| exit 1 | |
| fi | |
| echo "Found $changeset_count changeset(s)" | |
| find .changeset -name '*.md' ! -name 'README.md' -exec basename {} \; | |
| # Validate no major version bumps | |
| echo "" | |
| echo "Validating changeset types..." | |
| if find .changeset -name '*.md' ! -name 'README.md' \ | |
| -type f -exec grep -l '"major"' {} + 2>/dev/null | grep -q .; then | |
| echo "ERROR: Major version bump detected in changeset!" | |
| echo "" | |
| echo "Files with major bumps:" | |
| find .changeset -name '*.md' ! -name 'README.md' \ | |
| -type f -exec grep -l '"major"' {} + 2>/dev/null || true | |
| echo "" | |
| echo "Major version releases (1.0.0+) must be manually approved and coordinated." | |
| echo "Please change the version bump type to 'minor' or 'patch'." | |
| echo "" | |
| echo "If you truly need a major version bump, coordinate with maintainers first." | |
| exit 1 | |
| fi | |
| echo "No major version bumps detected" |