From fc570908c368bd385f1cbfe031f1cf6084bcdd11 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Tue, 24 Jun 2025 15:57:42 -0400 Subject: [PATCH 1/6] Use kat to verify changelogs --- .github/workflows/changelog-verification.yml | 37 ++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/changelog-verification.yml b/.github/workflows/changelog-verification.yml index 31f7a3e6f0f..81a52733daf 100644 --- a/.github/workflows/changelog-verification.yml +++ b/.github/workflows/changelog-verification.yml @@ -1,5 +1,8 @@ name: Changelog verification +permissions: + id-token: write + on: pull_request: types: [ opened, synchronize, reopened, labeled, unlabeled ] @@ -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 From 9c35c38d61f3f549671974c8b2364da015218087 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 25 Jun 2025 10:54:39 -0400 Subject: [PATCH 2/6] Use action from aws-kotlin-repo-tools --- .github/workflows/changelog-verification.yml | 23 ++------------------ 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/changelog-verification.yml b/.github/workflows/changelog-verification.yml index 81a52733daf..9a822a03a6c 100644 --- a/.github/workflows/changelog-verification.yml +++ b/.github/workflows/changelog-verification.yml @@ -20,24 +20,5 @@ jobs: 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 - 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: | - if ! kat changelog ls; then - echo "::error ::Changelog verification failed. Please check the format of your changelog entry." - exit 1 - fi + - name: Verify changelog + uses: awslabs/aws-kotlin-repo-tools/.github/actions/changelog-verification@misc-validate-changelogs \ No newline at end of file From bd8b0abf34dc8542c62b9c9ca8ca4b7cdb69af4b Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 25 Jun 2025 10:55:16 -0400 Subject: [PATCH 3/6] changelog --- .changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json diff --git a/.changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json b/.changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json new file mode 100644 index 00000000000..ece302bed96 --- /dev/null +++ b/.changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json @@ -0,0 +1,5 @@ +{ + "id": "70d47326-b0a7-4d9c-bdc0-1bba1a7debe6", + "type": "unsupported", + "description": "Testing invalid changelog" +} \ No newline at end of file From 7a837d46aefefcb69a58c23f0c4d58850abb2b4f Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 25 Jun 2025 11:00:58 -0400 Subject: [PATCH 4/6] CI From 13dbe86dcfaa6f7116bb3225e15d09988497fc40 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 25 Jun 2025 11:32:58 -0400 Subject: [PATCH 5/6] Reference main branch --- .github/workflows/changelog-verification.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-verification.yml b/.github/workflows/changelog-verification.yml index 9a822a03a6c..457764177f5 100644 --- a/.github/workflows/changelog-verification.yml +++ b/.github/workflows/changelog-verification.yml @@ -21,4 +21,4 @@ jobs: aws-region: us-west-2 - name: Verify changelog - uses: awslabs/aws-kotlin-repo-tools/.github/actions/changelog-verification@misc-validate-changelogs \ No newline at end of file + uses: awslabs/aws-kotlin-repo-tools/.github/actions/changelog-verification@main \ No newline at end of file From 4f1d7902d6a1fb649feb0d2afcfbeb3a398e8206 Mon Sep 17 00:00:00 2001 From: Matas Lauzadis Date: Wed, 25 Jun 2025 11:35:24 -0400 Subject: [PATCH 6/6] delete invalid changelog --- .changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json diff --git a/.changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json b/.changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json deleted file mode 100644 index ece302bed96..00000000000 --- a/.changes/70d47326-b0a7-4d9c-bdc0-1bba1a7debe6.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "70d47326-b0a7-4d9c-bdc0-1bba1a7debe6", - "type": "unsupported", - "description": "Testing invalid changelog" -} \ No newline at end of file