-
Notifications
You must be signed in to change notification settings - Fork 982
29 lines (26 loc) · 1.05 KB
/
changelog-verification.yml
File metadata and controls
29 lines (26 loc) · 1.05 KB
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
name: Changelog verification
permissions:
contents: read
pull-requests: read
on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches:
- master
jobs:
changelog-verification:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for changelog entry
if: ${{ !contains(github.event.pull_request.labels.*.name, 'changelog-not-required') }}
run: |
git fetch origin ${{ github.base_ref }} --depth 1 && \
git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/next-release/*[a-zA-Z0-9_-]+\.json"
- name: Error message
if: ${{ failure() }}
run: |
echo "::error ::No new/updated changelog entry found in /.changes/next-release directory. Please either:"
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–"
echo "::error ::* Add the 'changelog-not-required' label to this PR (in rare cases not warranting a changelog entry)"
exit 1