Repository navigation
68 lines (57 loc) · 2.4 KB
/
Copy pathchangeset.yml
File metadata and controls
68 lines (57 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: changeset
# Every PR that changes a publishable package must carry a changeset (see .changeset/README.md).
# Label the PR `no changeset` to skip, e.g. for docs or CI-only changes inside a package.
# The "Version Packages" PR opened by the release workflow is exempt: it consumes changesets.
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check:
name: Changed packages have a changeset
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no changeset') && !startsWith(github.head_ref, 'changeset-release/') }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # `changeset status --since` needs the history back to the base branch
persist-credentials: false
- name: Set up pnpm
uses: pnpm/action-setup@v6
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Changed packages have a changeset
run: pnpm changeset status --since=origin/${{ github.base_ref }}
# Non-blocking: comments on the PR which packages will be released, and at what bump level.
# Same-repo PRs only; the default token cannot comment on PRs from forks under `pull_request`.
status:
name: Comment changeset status
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !startsWith(github.head_ref, 'changeset-release/') }}
runs-on: ubuntu-latest
permissions:
contents: read # to check out repo (actions/checkout)
pull-requests: write # to create and update the status comment (changesets/action/pr-comment)
steps:
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Generate PR status
id: pr-status
uses: changesets/action/pr-status@v2
- name: Comment on PR
uses: changesets/action/pr-comment@v2
with:
body: ${{ steps.pr-status.outputs.comment-body }}