-
Notifications
You must be signed in to change notification settings - Fork 40
54 lines (51 loc) · 1.96 KB
/
changeset.yml
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
name: changeset
on:
pull_request:
types: [opened, synchronize]
jobs:
check-changeset:
name: 'Check changeset status'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
# Rush needs to diff against origin/main for changeset verification
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Rush tooling
run: npm install -g @microsoft/rush
- name: Find comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: CHANGESET_MESSAGE
- name: Check changeset status
id: verify
run: rush change --verify | grep 'Found change file' &> /dev/null
continue-on-error: true
- name: Comment on changeset success
if: ${{ steps.verify.outcome == 'success' }}
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- CHANGESET_MESSAGE -->
### ✅ Changeset has been found!
**This will create and publish a new version to NPM after a successful merge.**
edit-mode: replace
- name: Comment on changeset failure
if: ${{ steps.verify.outcome == 'failure' }}
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- CHANGESET_MESSAGE -->
### ❌ No changeset has been found!
**This means no version will be published on merge.**
If you would like this PR to create a new version on merge, please run `rush change` and commit the generated change description files to this branch.
edit-mode: replace