Files
better-auth/.github/workflows/verify-changesets.yml
dependabot[bot]andGitHub 2d57f16f6f chore(deps): bump the github-actions group across 1 directory with 14 updates
Bumps the github-actions group with 14 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `6.0.3` | `7.0.1` |
| [pnpm/action-setup](https://github.com/pnpm/action-setup) | `6.0.8` | `6.1.0` |
| [actions/setup-node](https://github.com/actions/setup-node) | `6.4.0` | `7.1.0` |
| [actions/labeler](https://github.com/actions/labeler) | `6.1.0` | `7.0.0` |
| [korthout/backport-action](https://github.com/korthout/backport-action) | `4.5.2` | `4.7.0` |
| [actions/cache](https://github.com/actions/cache) | `5.0.5` | `6.1.0` |
| [re-actors/alls-green](https://github.com/re-actors/alls-green) | `1.2.2` | `1.3.0` |
| [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) | `1.0.142` | `1.0.248` |
| [denoland/setup-deno](https://github.com/denoland/setup-deno) | `2.0.4` | `2.0.5` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.2` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.1` | `8.0.2` |
| [changesets/action](https://github.com/changesets/action) | `1.9.0` | `2.1.2` |
| [marocchino/sticky-pull-request-comment](https://github.com/marocchino/sticky-pull-request-comment) | `3.0.4` | `3.0.5` |
| [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.5.6` | `0.6.4` |



Updates `actions/checkout` from 6.0.3 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...3d3c42e5aac5ba805825da76410c181273ba90b1)

Updates `pnpm/action-setup` from 6.0.8 to 6.1.0
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/0e279bb959325dab635dd2c09392533439d90093...ea17c68df8912ef543352723c149a84f56e3d413)

Updates `actions/setup-node` from 6.4.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...949feb2413d6458794dcd2491c4babbbce0c15c1)

Updates `actions/labeler` from 6.1.0 to 7.0.0
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/f27b608878404679385c85cfa523b85ccb86e213...bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13)

Updates `korthout/backport-action` from 4.5.2 to 4.7.0
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](https://github.com/korthout/backport-action/compare/66065406958f46e82238fd59546f5a99e69e22aa...8560fb503c275d433c56f05a2f64850093baa9f7)

Updates `actions/cache` from 5.0.5 to 6.1.0
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/27d5ce7f107fe9357f9df03efb73ab90386fccae...55cc8345863c7cc4c66a329aec7e433d2d1c52a9)

Updates `re-actors/alls-green` from 1.2.2 to 1.3.0
- [Release notes](https://github.com/re-actors/alls-green/releases)
- [Commits](https://github.com/re-actors/alls-green/compare/05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe...b5b5b37504aa4183270bd3d855c52a67f212be35)

Updates `anthropics/claude-code-action` from 1.0.142 to 1.0.248
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](https://github.com/anthropics/claude-code-action/compare/11ba60486e4aec9ddfeafcf4bb3f00b028ac2c16...1d6de8cb0c237e7c15e9e1bdf973826ebae490cc)

Updates `denoland/setup-deno` from 2.0.4 to 2.0.5
- [Release notes](https://github.com/denoland/setup-deno/releases)
- [Commits](https://github.com/denoland/setup-deno/compare/667a34cdef165d8d2b2e98dde39547c9daac7282...22d081ff2d3a40755e97629de92e3bcbfa7cf2ed)

Updates `actions/upload-artifact` from 4.6.2 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.6.2...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

Updates `changesets/action` from 1.9.0 to 2.1.2
- [Release notes](https://github.com/changesets/action/releases)
- [Changelog](https://github.com/changesets/action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/changesets/action/compare/a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d...ae32849d5ba541f9ae29e40e22a623bc13562f51)

Updates `marocchino/sticky-pull-request-comment` from 3.0.4 to 3.0.5
- [Release notes](https://github.com/marocchino/sticky-pull-request-comment/releases)
- [Commits](https://github.com/marocchino/sticky-pull-request-comment/compare/0ea0beb66eb9baf113663a64ec522f60e49231c0...5770ad5eb8f42dd2c4f34da00c94c5381e49af88)

Updates `zizmorcore/zizmor-action` from 0.5.6 to 0.6.4
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/5f14fd08f7cf1cb1609c1e344975f152c7ee938d...cc914d7f3750a2d13d75c7f184a1060aa0e9d482)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: pnpm/action-setup
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/labeler
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: korthout/backport-action
  dependency-version: 4.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/cache
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: re-actors/alls-green
  dependency-version: 1.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.248
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: denoland/setup-deno
  dependency-version: 2.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: changesets/action
  dependency-version: 2.1.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: marocchino/sticky-pull-request-comment
  dependency-version: 3.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.6.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-18 04:14:52 +00:00

182 lines
6.7 KiB
YAML

name: Verify Changesets
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled, edited]
branches:
- main
- next
- 'v*.*.x'
merge_group:
workflow_call:
permissions: {}
jobs:
verify:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Evaluate exemptions
id: gate
env:
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
UPSTREAM_REPO: ${{ github.repository }}
run: |
exempt=false
reason=""
if [ "$GITHUB_EVENT_NAME" = "merge_group" ]; then
exempt=true
reason="merge_group event (verification ran on the source PR)"
elif [ "$HEAD_REPO" = "$UPSTREAM_REPO" ]; then
case "$HEAD_REF" in
changeset-release/*)
exempt=true
reason="release PR from changeset-release/* branch"
;;
esac
if [ "$exempt" = "false" ]; then
if [ "$HEAD_REF" = "next" ] && [ "$BASE_REF" = "main" ]; then
exempt=true
reason="next -> main promotion PR"
elif [ "$HEAD_REF" = "main" ] && [ "$BASE_REF" = "next" ]; then
exempt=true
reason="main -> next sync PR"
fi
fi
fi
{
echo "exempt=$exempt"
echo "reason=$reason"
} >> "$GITHUB_OUTPUT"
if [ "$exempt" = "true" ]; then
echo "Verification exempt: $reason"
fi
- name: Checkout
if: steps.gate.outputs.exempt == 'false'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Block pre.json on main
if: steps.gate.outputs.exempt == 'false' && github.base_ref == 'main'
env:
BASE_REF: ${{ github.base_ref }}
run: |
if git diff --diff-filter=d --name-only "origin/$BASE_REF"...HEAD | grep -q '^\.changeset/pre\.json$'; then
echo "::error::.changeset/pre.json must not be committed to main. Pre-release mode belongs on the 'next' branch only."
exit 1
fi
- name: Get changed changeset files
id: changed
if: steps.gate.outputs.exempt == 'false'
env:
BASE_REF: ${{ github.base_ref }}
run: |
FILES=$(git diff --diff-filter=dr --name-only "origin/$BASE_REF"...HEAD -- '.changeset/*.md' | grep -v 'README.md' || true)
COUNT=$(echo "$FILES" | grep -c '.' || true)
{
echo "files<<EOF"
echo "$FILES"
echo "EOF"
echo "count=$COUNT"
echo "has_changesets=$( [ "$COUNT" -gt 0 ] && echo true || echo false )"
} >> "$GITHUB_OUTPUT"
- name: Check package changes require changeset
if: steps.gate.outputs.exempt == 'false' && steps.changed.outputs.has_changesets == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.base_ref }}
run: |
LABELS=$(gh pr view "$PR_NUMBER" --json labels --jq '.labels[].name' 2>/dev/null || echo "")
if echo "$LABELS" | grep -q "skip-changeset"; then
echo "Changeset not required (skip-changeset label present)"
exit 0
fi
PKG_CHANGES=$(git diff --name-only "origin/$BASE_REF"...HEAD -- \
'packages/' ':(exclude)packages/release-tooling/**' | grep -c '.' || true)
if [ "$PKG_CHANGES" -eq 0 ]; then
echo "Changeset not required (no package changes)"
exit 0
fi
echo "::error::Missing changeset. Add one with 'pnpm changeset' or add the 'skip-changeset' label."
exit 1
- name: Validate changeset files
if: steps.gate.outputs.exempt == 'false' && steps.changed.outputs.has_changesets == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.base_ref }}
CHANGESET_FILES: ${{ steps.changed.outputs.files }}
run: |
HAS_ERROR=0
for f in $CHANGESET_FILES; do
if [ -L "$f" ]; then
echo "::error::Changeset $f is a symlink, which is not allowed."
HAS_ERROR=1
continue
fi
BASENAME=$(basename "$f")
if ! echo "$BASENAME" | grep -qE '^[a-z][a-z0-9-]*\.md$'; then
echo "::error::Changeset $f has an invalid filename. Use only lowercase letters, digits, and hyphens."
HAS_ERROR=1
continue
fi
if ! head -1 "$f" | grep -q '^---$'; then
echo "::error::Changeset $f is missing YAML frontmatter opening fence."
HAS_ERROR=1
continue
fi
if ! sed -n '2,$ p' "$f" | grep -q '^---$'; then
echo "::error::Changeset $f is missing YAML frontmatter closing fence."
HAS_ERROR=1
continue
fi
BODY=$(sed -n '2,/^---$/p' "$f" | head -n -1)
while IFS= read -r line; do
[ -z "$line" ] && continue
if ! echo "$line" | grep -qE '^"[^"]+"\s*:\s*(major|minor|patch|none)\s*$'; then
echo "::error::Changeset $f has invalid entry: $line (expected '\"package-name\": patch|minor|major|none')"
HAS_ERROR=1
fi
done <<< "$BODY"
done
[ "$HAS_ERROR" -ne 0 ] && exit 1
if [ "$BASE_REF" = "main" ] || [[ "$BASE_REF" =~ ^v[0-9]+\.[0-9]+\.x$ ]]; then
for f in $CHANGESET_FILES; do
BUMPS=$(sed -n '/^---$/,/^---$/p' "$f" | grep -oE '(major|minor|patch)' | sort -u)
if echo "$BUMPS" | grep -q "major"; then
echo "::error::Changeset $f contains a 'major' bump. Only 'patch' bumps are allowed on '$BASE_REF'. PRs with minor/major bumps should target 'next' (auto-retarget may not have run yet)."
exit 1
fi
if echo "$BUMPS" | grep -q "minor"; then
echo "::error::Changeset $f contains a 'minor' bump. Only 'patch' bumps are allowed on '$BASE_REF'. PRs with minor/major bumps should target 'next' (auto-retarget may not have run yet)."
exit 1
fi
done
echo "All changesets are patch-only ($BASE_REF branch policy)"
else
echo "Target is $BASE_REF, all bump types allowed"
fi