-
Notifications
You must be signed in to change notification settings - Fork 102
60 lines (53 loc) · 2.09 KB
/
changelog.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
55
56
57
58
59
60
name: Verify Changelog
# If you modify more test jobs, ensure that you add them as required to the job "confirmChangelogChecksPassed"
# which is located at the end of this file (more info in the job)
on:
push:
branches: ["main", "release-*"]
pull_request:
types: [opened, reopened, synchronize, edited]
workflow_dispatch:
# cancel previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Job required by "confirmChangelogChecksPassed"
verify-changelog-updated:
name: Verify that Changelog is Updated
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: Get Changed Files
id: changed
uses: foodee/pr-includes-file-change@master
with:
paths: ^CHANGELOG.md
- name: Set error
if: steps.changed.outputs.matched != 'true' && !contains(github.event.pull_request.body, '[x] Does not require a CHANGELOG entry')
run: echo "::error::CHANGELOG.md has not been modified. Either modify the file or check the checkbox in the body" && exit 1
# Job required by "confirmChangelogChecksPassed"
verify-changelog-valid:
name: Verify that Changelog is valid
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Verify
run: .github/changelog-processor.py CHANGELOG.md --validate-changelog
# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
# it will still require all the steps to succeed.
# If you add more jobs, remember to add them to the "needs" array.
confirmChangelogChecksPassed:
runs-on: ubuntu-latest
name: All changelog checks passed
# If any new job gets added, be sure to add it to this list
needs:
- verify-changelog-updated
- verify-changelog-valid
steps:
- run: echo '### Good job! All the changelog checks passed 🚀' >> $GITHUB_STEP_SUMMARY