test: canonical removeTree helper and a lint gate on bare recursive rm #1730
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 | |
| # Every pull request that changes a publishable package must ship a | |
| # `.changeset/*.md` entry (see .changeset/README.md and AGENTS.md). This | |
| # lives outside ci.yml on purpose: toggling the `skip-changeset` label must | |
| # re-evaluate only this check, not re-run the heavy CI matrix. | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| # "Changeset present" is a required check on main, so a merge queue entry | |
| # needs a passing context too (see the merge_group note in ci.yml; dormant | |
| # until the repository is organization-owned). The requirement itself is | |
| # enforced on the pull request, which must already be green to enter the | |
| # queue; the queue run only reports success, because a merge_group event | |
| # carries no PR labels and its commit stacks earlier queue entries. | |
| merge_group: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: changeset-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| changeset: | |
| name: Changeset present | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Merge queue entry — requirement already enforced on the pull request | |
| if: github.event_name == 'merge_group' | |
| run: echo "::notice::merge_group run; the changeset requirement was checked on the pull request." | |
| # `changeset status --since=origin/main` diffs against the merge-base | |
| # with main, so the PR merge commit needs enough history to reach it. | |
| - uses: actions/checkout@v7 | |
| if: github.event_name != 'merge_group' | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup-workspace | |
| if: github.event_name != 'merge_group' | |
| with: | |
| node-version: 22.19.0 | |
| - name: Require a changeset for publishable package changes | |
| if: github.event_name != 'merge_group' | |
| env: | |
| SKIP_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'skip-changeset') }} | |
| # Only the machine-owned release branch of this repository is exempt; | |
| # a fork or contributor branch that happens to share the name is not. | |
| IS_RELEASE_BRANCH: >- | |
| ${{ github.event.pull_request.head.ref == 'changeset-release/main' && | |
| github.event.pull_request.head.repo.full_name == github.repository }} | |
| run: | | |
| set -euo pipefail | |
| if [ "$SKIP_LABEL" = "true" ]; then | |
| echo "::notice::skip-changeset label present; not requiring a changeset." | |
| exit 0 | |
| fi | |
| if [ "$IS_RELEASE_BRANCH" = "true" ]; then | |
| echo "::notice::Version Packages branch; changesets are consumed here, not added." | |
| exit 0 | |
| fi | |
| # Exit 1 when a publishable package changed (per changedFilePatterns | |
| # in .changeset/config.json; tests/** is exempt) and this PR adds no | |
| # .changeset/*.md. Docs-only and private-package changes need none. | |
| if ! pnpm changeset status --since=origin/main --verbose; then | |
| echo "::error::This PR changes a publishable package (agent-bundle, @agent-bundle/runtime, create-agent-bundle) without a changeset. Run 'pnpm changeset' (or add .changeset/<slug>.md) — see .changeset/README.md. For a genuinely no-op change, apply the 'skip-changeset' label." | |
| exit 1 | |
| fi |