-
Notifications
You must be signed in to change notification settings - Fork 75
35 lines (28 loc) · 1.02 KB
/
changelog-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
name: CHANGELOG Check
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled, edited]
env:
CHANGELOG_REQUIRED: true
IGNORE_CHECK_LABEL: allow-no-changelog
jobs:
changelog-check:
runs-on: ubuntu-latest
steps:
- name: Override variable if PR is labeled ${{ env.IGNORE_CHECK_LABEL }}
if: ${{ contains(github.event.pull_request.labels.*.name, env.IGNORE_CHECK_LABEL) }}
run: |
echo "CHANGELOG_REQUIRED=false" >> $GITHUB_ENV
- uses: actions/checkout@v3
if: fromJSON(env.CHANGELOG_REQUIRED)
- name: Get changed files in the docs folder
if: fromJSON(env.CHANGELOG_REQUIRED)
id: changelog-changed
uses: tj-actions/changed-files@v41
with:
files: CHANGELOG.md
- name: Fail workflow if CHANGELOG.md has not been changed
if: fromJSON(env.CHANGELOG_REQUIRED) && steps.changelog-changed.outputs.any_changed == 'false'
run: |
echo "CHANGELOG.md has not been changed"
exit 1