-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (65 loc) · 2.4 KB
/
changeset.yml
File metadata and controls
81 lines (65 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
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Changeset
on:
pull_request:
types:
- opened
- reopened
- labeled
- unlabeled
- edited
- synchronize
branches:
- main
- next
permissions: {}
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.number }}'
cancel-in-progress: true
jobs:
require-changeset:
name: Require Changeset
runs-on: ubuntu-latest
permissions:
contents: read
# Skip opted out PRs, and release PRs
if: |
! contains(github.event.pull_request.labels.*.name, 'skip changelog') &&
! (github.event.pull_request.title == 'chore(release): publish' && github.event.pull_request.user.login == 'github-actions[bot]') &&
! (github.event.pull_request.user.login == 'dependabot[bot]')
steps:
- name: Checkout source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Install Dependencies
uses: ./.github/actions/install
# Returns exit code 1 when there are changes without changesets attached to them.
# See: https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md#blocking
- name: Run Changesets
run: pnpm changeset status --since origin/${{ github.event.pull_request.base.ref }}
disallow-major-release:
name: Disallow Major Release
runs-on: ubuntu-latest
permissions:
contents: read
# Block major releases only on main, allow on next.
# Skip release & dependabot PRs.
if: |
github.event.pull_request.base.ref == 'main' &&
! (github.event.pull_request.title == 'chore(release): publish' && github.event.pull_request.user.login == 'github-actions[bot]') &&
! (github.event.pull_request.user.login == 'dependabot[bot]')
steps:
- name: Checkout source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Install Dependencies
uses: ./.github/actions/install
- name: Check for Major Changeset
run: |
pnpm changeset status --since origin/main --output=./.changeset-status.json &> /dev/null || true
if [ -f ./.changeset-status.json ]; then
node .github/scripts/check-major-version.ts ./.changeset-status.json
fi