-
Notifications
You must be signed in to change notification settings - Fork 22
55 lines (48 loc) · 1.64 KB
/
changelog-changes.yaml
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
name: "Check if CHANGELOG file was modified in PR"
on:
pull_request:
branches: main
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.config/**'
- '.github/**'
- 'docs/**'
- 'local/**'
jobs:
analyze:
runs-on: ubuntu-latest
permissions:
pull-requests: write
name: changelog-check
steps:
- uses: actions/checkout@v4
- name: Check if CHANGELOG file was changed
id: changelog-changed
uses: tj-actions/changed-files@v44
with:
files: |
CHANGELOG.md
- name: Echo result if CHANGELOG file was changed
if: steps.changelog-changed.outputs.any_changed == 'true'
run: |
for file in ${{ steps.changelog-changed.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Find previous comment in PR
if: steps.changelog-changed.outputs.any_changed == 'false'
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: CHANGELOG file was not updated! Make sure to include important changes.
- name: Create or update comment in PR
if: steps.changelog-changed.outputs.any_changed == 'false'
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
CHANGELOG file was not updated! Make sure to include important changes.
edit-mode: replace