Skip to content

Commit 965b758

Browse files
committed
add PR build check for changelog
1 parent 0bb100a commit 965b758

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
@@ -8,6 +8,37 @@ env:
88
TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test-v2
99

1010
jobs:
11+
changelog-check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Check CHANGELOG
19+
run: |
20+
# Check if PR is from bot
21+
if [[ "${{ github.event.pull_request.user.login }}" == "aws-application-signals-bot" ]]; then
22+
echo "Skipping: PR from aws-application-signals-bot"
23+
exit 0
24+
fi
25+
26+
# Check for Skip Changelog label
27+
if echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -q "Skip Changelog"; then
28+
echo "Skip Changelog label found - check passed"
29+
exit 0
30+
fi
31+
32+
# Fetch base branch and check for CHANGELOG modifications
33+
git fetch origin ${{ github.base_ref }}
34+
if git diff --name-only origin/${{ github.base_ref }}..HEAD | grep -q "CHANGELOG.md"; then
35+
echo "CHANGELOG.md entry found - check passed"
36+
exit 0
37+
fi
38+
39+
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."
40+
exit 1
41+
1142
testpatch:
1243
name: Test patches applied to dependencies
1344
runs-on: aws-otel-java-instrumentation_ubuntu-latest_32-core

0 commit comments

Comments
 (0)