Skip to content

Commit 71e803f

Browse files
committed
Add changelog verification yaml
1 parent 341bee3 commit 71e803f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Changelog verification
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize, reopened, labeled, unlabeled ]
6+
branches:
7+
- master
8+
9+
jobs:
10+
changelog-verification:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Check for changelog entry
15+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog') }}
16+
run: |
17+
git fetch origin ${{ github.base_ref }} --depth 1 && \
18+
git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/next-release/[0-9a-f-]+\.json"
19+
- name: Error message
20+
if: ${{ failure() }}
21+
run: |
22+
echo "::error ::No new/updated changelog entry found in /.changes/next-release directory. Please either:"
23+
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–"
24+
echo "::error ::* Add the 'no-changelog' label to this PR (in rare cases not warranting a changelog entry)"
25+
exit 1

0 commit comments

Comments
 (0)