Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Changesets

## Adding a release note

Run `npm run changeset` for a releasable change, choose the package and version bump,
and describe the change. Commit the generated `.changeset/*.md` file with your PR.
Include runtime dependency updates that need a release, especially security fixes.
Docs, tests, and development-only tooling changes do not normally need a changeset.

The **Check for changeset** PR check requires an added or updated `.changeset/*.md`
file other than this README, or the `skip-changeset` label. Use the label for changes
that do not need a release, including development-only dependency bumps, not as a
blanket exemption for runtime dependency updates. Adding or removing the label
reruns the check; other CI checks still run. Release tracking PRs receive this
label automatically because they consume existing changesets.
To block merging without this check, make **Check for changeset** a required status
check in the repository's branch protection or ruleset.

## Preparing and publishing a release

The **Release tracking** workflow opens or updates a PR on pushes to `main` when
changesets are pending. It updates the package version, lockfile, and changelog.
Review and merge that PR, then manually create a GitHub release from its merged
commit, using a tag matching the version in `package.json`.
The existing **Publish** workflow handles publishing. Merging the tracking PR
does not publish packages or create tags or GitHub releases.

For local release preparation, run `npm run version-packages`.
Changes merged before this setup still need a one-time review and changesets for
anything that needs releasing; initialization does not backfill release notes.

## Workflow permissions

Enable **Allow GitHub Actions to create and approve pull requests** in the
repository's Actions settings. The workflow uses `GITHUB_TOKEN` without an npm token.
PRs opened with this token do not automatically trigger other Actions workflows.
If required PR checks depend on those events, use an approved GitHub App token
before enabling the automation.

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets).

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
37 changes: 37 additions & 0 deletions .github/workflows/check-for-changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check for changeset

on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]

permissions:
contents: read
pull-requests: read

jobs:
check-for-changeset:
name: Check for changeset
runs-on: ubuntu-latest
steps:
- name: Check for changeset or skip label
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
labels="$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" --jq '.labels[].name')"
if grep -Fxq 'skip-changeset' <<<"$labels"; then
echo 'Skipping the changeset requirement because skip-changeset is set.'
exit 0
fi
changed_files="$(gh api --paginate "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files" \
--jq '.[] | select(.status != "removed" and .filename != ".changeset/README.md") | .filename')"
if grep -Eq '^\.changeset/[^/]+\.md$' <<<"$changed_files"; then
echo 'Found a changeset in this pull request.'
exit 0
fi
echo '::error::Add a release note with npm run changeset, or apply skip-changeset if this PR does not need a release.'
exit 1
48 changes: 48 additions & 0 deletions .github/workflows/release-tracking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release tracking

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: release-tracking-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: read

jobs:
release-tracking:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- run: npm ci --ignore-scripts
- name: Create or update release tracking pull request
id: changesets
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3 (Changesets CLI v2)
with:
version: npm run version-packages
title: Release tracking
commit: Prepare release
commitMode: github-api
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Skip changeset requirement for the release tracking pull request
if: steps.changesets.outputs.pullRequestNumber != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }}
run: gh api --method POST "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" -f 'labels[]=skip-changeset'
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ npm test

To publish a new version:

1. Run `npm version <version> --no-git-tag-version` (for example, `npm version 4.10.0 --no-git-tag-version`) to update the version in `package.json` and `package-lock.json`.
2. Open a pull request with the version change and merge it into `main`.
3. Create a GitHub release from `main` with a tag that exactly matches the new version (for example, `4.10.0`).
1. Include a [changeset](.changeset/README.md) with each releasable change.
2. Review and merge the automated **Release tracking** pull request when ready to release. It updates `package.json`, `package-lock.json`, and `CHANGELOG.md`.
3. Create a GitHub release from the merged commit with a tag that exactly matches the new version (for example, `4.10.0`).

Creating the release triggers the [Publish workflow](https://github.com/github/tab-container-element/actions/workflows/publish.yml), which tests the tagged commit and publishes the package to npm automatically.

Expand Down
Loading