Skip to content

Commit f5659dc

Browse files
committed
ci: enfore changelog entry on PR
1 parent 6c79910 commit f5659dc

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Changelog Requirement
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize, labeled, unlabeled ]
6+
paths:
7+
- 'gateway/**'
8+
9+
jobs:
10+
require-changelog:
11+
if: ${{ !contains(github.event.*.labels.*.name, 'skip-changelog') }}
12+
name: Requires changelog
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Find changelog files
20+
id: changelog-file
21+
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
22+
with:
23+
# Avoid using single or double quotes for multiline patterns
24+
files: |
25+
CHANGELOG.md
26+
27+
- name: Check changelog existence
28+
if: steps.changelog-file.outputs.any_changed == 'false'
29+
run: |
30+
echo("Please include a CHANGELOG entry. You can find it at [CHANGELOG.md](https://github.com/3scale/apicast/blob/master/CHANGELOG.md)."
31+
echo "Note, we hard-wrap at 80 chars and use 2 spaces after the last line."
32+
echo "If you believe this PR requires no changelog entry, label it with \"skip-changelog\"."
33+
exit 1

0 commit comments

Comments
 (0)