-
Notifications
You must be signed in to change notification settings - Fork 20
48 lines (41 loc) · 1.95 KB
/
changelog.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
name: Changelog Checker
on:
pull_request:
types: [opened, edited, synchronize, reopened]
branches:
- main
jobs:
change:
name: Changelog Checker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- if: ${{ contains(github.event.pull_request.title, 'NO-CHANGELOG') }}
name: Add comment about skipping check
uses: mshick/add-pr-comment@v2
with:
message: |
Skipping changelog updated check. Detected `NO-CHANGELOG` in PR title.
- if: ${{ !contains(github.event.pull_request.title, 'NO-CHANGELOG') }}
name: Check Changelog Updated
id: changelog
run: |
echo "CHANGELOG_UPDATED=$(git diff --name-only --diff-filter=ACMRTUXB origin/main origin/${GITHUB_HEAD_REF} CHANGELOG.md)" >> $GITHUB_OUTPUT
- if: contains(github.event.pull_request.title, 'NO-CHANGELOG') == false && steps.changelog.outputs.CHANGELOG_UPDATED != 'CHANGELOG.md'
name: Run step only when any of the above files changed.
uses: mshick/add-pr-comment@v2
with:
message: |
No changelog updated detected, please add a summary of changes to CHANGELOG.md. For recomended changelog format please see [this guidelines](https://immutable.atlassian.net/wiki/spaces/PPS/pages/2146862207/Changelog+Guidelines+for+Unified+SDK). If no notable changes to be added to changelog, please add `NO-CHANGELOG` to PR title.
- if: contains(github.event.pull_request.title, 'NO-CHANGELOG') == false && steps.changelog.outputs.CHANGELOG_UPDATED != 'CHANGELOG.md'
run: |
exit 1
- if: contains(github.event.pull_request.title, 'NO-CHANGELOG') == false && steps.changelog.outputs.CHANGELOG_UPDATED == 'CHANGELOG.md'
name: Update the status message.
uses: mshick/add-pr-comment@v2
with:
message: |
Changelog update detected!