Skip to content

Commit 8f7a410

Browse files
committed
add PR build check that CHANGELOG was modified
1 parent 2f80a61 commit 8f7a410

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/pr-build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,42 @@ permissions:
1010
contents: read
1111

1212
jobs:
13+
changelog-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Check CHANGELOG
21+
run: |
22+
# Check if PR is from workflows bot or dependabot
23+
if [[ "${{ github.event.pull_request.user.login }}" == "aws-application-signals-bot" ]]; then
24+
echo "Skipping check: PR from aws-application-signals-bot"
25+
exit 0
26+
fi
27+
28+
if [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
29+
echo "Skipping check: PR from dependabot"
30+
exit 0
31+
fi
32+
33+
# Check for Skip Changelog label
34+
if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "skip changelog"; then
35+
echo "Skipping check: Skip Changelog label found"
36+
exit 0
37+
fi
38+
39+
# Fetch base branch and check for CHANGELOG modifications
40+
git fetch origin ${{ github.base_ref }}
41+
if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -q "CHANGELOG.md"; then
42+
echo "CHANGELOG.md entry found - check passed"
43+
exit 0
44+
fi
45+
46+
echo "It looks like you didn't add an entry to CHANGELOG.md. If this change affects the SDK behavior, please update CHANGELOG.md and link this PR in your entry. If this PR does not need a CHANGELOG entry, you can add the 'Skip Changelog' label to this PR."
47+
exit 1
48+
1349
build:
1450
runs-on: ubuntu-latest
1551
strategy:

0 commit comments

Comments
 (0)