Skip to content

Commit d1a5bf8

Browse files
authored
chore: enable verification of changelog entries for PRs (#668)
1 parent 76960e0 commit d1a5bf8

File tree

1 file changed

+24
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)