Skip to content

Commit 73a2089

Browse files
committed
add PR check that CHANGELOG was modified
1 parent ca5b73b commit 73a2089

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pr-build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,37 @@ 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 pre-release or post-release workflow
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+
# Check for Skip Changelog label
29+
if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "Skip Changelog"; then
30+
echo "Skipping check: Skip Changelog label found"
31+
exit 0
32+
fi
33+
34+
# Fetch base branch and check for CHANGELOG modifications
35+
git fetch origin ${{ github.base_ref }}
36+
if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -q "CHANGELOG.md"; then
37+
echo "CHANGELOG.md entry found - check passed"
38+
exit 0
39+
fi
40+
41+
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."
42+
exit 1
43+
1344
build:
1445
runs-on: ubuntu-latest
1546
strategy:

0 commit comments

Comments
 (0)