Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions .github/workflows/changelog-verification.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Changelog verification

permissions:
id-token: write

on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
Expand All @@ -11,16 +14,30 @@ jobs:
changelog-verification:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for changelog entry
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2

- name: Setup kat
uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main

- uses: actions/checkout@v2
- name: Check for new changelog entry
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog') }}
run: |
git fetch origin ${{ github.base_ref }} --depth 1 && \
git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/[0-9a-f-]+\.json"
- name: Error message
if: ${{ failure() }}
git fetch origin ${{ github.base_ref }} --depth 1
if ! git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/[0-9a-f-]+\.json"; then
echo "::error ::No new/updated changelog entry found in /.changes directory. Please either:"
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–"
echo "::error ::* Add the 'no-changelog' label to this PR (in rare cases not warranting a changelog entry)"
exit 1
fi

- name: Verify all changelogs
run: |
echo "::error ::No new/updated changelog entry found in /.changes directory. Please either:"
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–"
echo "::error ::* Add the 'no-changelog' label to this PR (in rare cases not warranting a changelog entry)"
exit 1
if ! kat changelog ls; then
echo "::error ::Changelog verification failed. Please check the format of your changelog entry."
exit 1
fi
Loading