Skip to content

Commit fc57090

Browse files
committed
Use kat to verify changelogs
1 parent 11ea51a commit fc57090

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed
Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Changelog verification
22

3+
permissions:
4+
id-token: write
5+
36
on:
47
pull_request:
58
types: [ opened, synchronize, reopened, labeled, unlabeled ]
@@ -11,16 +14,30 @@ jobs:
1114
changelog-verification:
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: actions/checkout@v4
15-
- name: Check for changelog entry
17+
- name: Configure AWS Credentials
18+
uses: aws-actions/configure-aws-credentials@v4
19+
with:
20+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
21+
aws-region: us-west-2
22+
23+
- name: Setup kat
24+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main
25+
26+
- uses: actions/checkout@v2
27+
- name: Check for new changelog entry
1628
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog') }}
1729
run: |
18-
git fetch origin ${{ github.base_ref }} --depth 1 && \
19-
git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/[0-9a-f-]+\.json"
20-
- name: Error message
21-
if: ${{ failure() }}
30+
git fetch origin ${{ github.base_ref }} --depth 1
31+
if ! git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/[0-9a-f-]+\.json"; then
32+
echo "::error ::No new/updated changelog entry found in /.changes directory. Please either:"
33+
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–"
34+
echo "::error ::* Add the 'no-changelog' label to this PR (in rare cases not warranting a changelog entry)"
35+
exit 1
36+
fi
37+
38+
- name: Verify all changelogs
2239
run: |
23-
echo "::error ::No new/updated changelog entry found in /.changes directory. Please either:"
24-
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–"
25-
echo "::error ::* Add the 'no-changelog' label to this PR (in rare cases not warranting a changelog entry)"
26-
exit 1
40+
if ! kat changelog ls; then
41+
echo "::error ::Changelog verification failed. Please check the format of your changelog entry."
42+
exit 1
43+
fi

0 commit comments

Comments
 (0)