-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.86 KB
/
template_changeset_check.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
name: Changeset Check
on: workflow_call
jobs:
changeset-check:
name: changeset-check
if: (!contains(github.event.pull_request.user.login , '[bot]'))
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Check for changesets
id: changeset-files
uses: tj-actions/[email protected]
with:
files: .changeset/*.md
base_sha: ${{ github.event.pull_request.base.sha }}
- name: Find existing comment
uses: peter-evans/[email protected]
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: <!-- changeset-check -->
- name: Update comment for found changeset
uses: peter-evans/[email protected]
if: steps.changeset-files.outputs.any_changed == 'true'
with:
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- changeset-check -->
## 🦋 Changeset file found
Good job! A changeset file has been added in this PR. Your changes will be included in the next release.
edit-mode: replace
- name: Update comment for missing changeset
uses: peter-evans/[email protected]
if: steps.changeset-files.outputs.any_changed != 'true'
with:
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- changeset-check -->
## ⚠️ Changeset file missing
No changeset file has been added in this PR. Please consider adding one if this PR contains user-facing changes.
edit-mode: replace