diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index 5acc705dea3..dc318badaba 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -7,6 +7,7 @@ on: - 'kong/**' - '**.rockspec' - '.requirements' + - 'changelog/**' jobs: require-changelog: @@ -18,15 +19,49 @@ jobs: with: fetch-depth: 2 - - name: computes changed files - id: changelog-check + - name: Find changelog files + id: changelog-list uses: tj-actions/changed-files@db153baf731265ad02cd490b07f470e2d55e3345 # v37 with: - files: 'changelog/unreleased/**/*.yml' + files_yaml: | + changelogs: + - 'changelog/unreleased/**/*.yml' + upper_case: + - 'CHANGELOG/**' + numbered: + - 'changelog/unreleased/**/[0-9]+.yml' - - name: asserts changelog added + - name: Check changelog existence + if: steps.changelog-list.outputs.changelogs_any_changed == 'false' run: > - if [ "${{ steps.changelog-check.outputs.all_changed_and_modified_files_count }}" = "0" ]; then - echo "Should contain at least one changelog file in changelog/unreleased/*/ directory" - exit 1 - fi + echo "Changelog file expected but found none. If you believe this PR requires no changelog entry, label it with \"skip-changelog\"." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + exit 1 + + - name: Check correct case for changelog directory + if: steps.changelog-list.outputs.upper_case_any_changed == 'true' + run: | + echo "Please use \"changelog\" (all lowercase) for changelog modifications." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + echo "Bad file(s): ${{ steps.changelog-list.outputs.upper_case_all_changed_files }}" + exit 1 + + - name: Check descriptive filename for changelog entry + if: steps.changelog-list.outputs.numbered_any_changed == 'true' + run: | + echo "Please use short descriptive name for changelog files instead of numbers." + echo "E.g. bump_openresty.yml instead of 12345.yml." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + echo "Bad file(s): ${{ steps.changelog-list.outputs.numbered_all_changed_files }}" + exit 1 + + - name: Fail when deprecated YAML keys are used + run: > + for file in ${{ steps.changelog-list.outputs.changelogs_all_changed_files }}; do + if grep -q "prs:" $file || grep -q "jiras:" $file; then + echo "Please do not include \"prs\" or \"jiras\" keys in new changelogs, put the JIRA number inside commit message and PR description instead." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + echo "Bad file: $file" + exit 1 + fi + done diff --git a/changelog/unreleased/kong/fix_patch_order.yml b/changelog/unreleased/kong/fix_patch_order.yml index 00089c0d848..4928a8fabb4 100644 --- a/changelog/unreleased/kong/fix_patch_order.yml +++ b/changelog/unreleased/kong/fix_patch_order.yml @@ -1,7 +1,3 @@ message: fix the building failure when applying patches type: bugfix scope: Core -prs: - - 11696 -jiras: - - KAG-2712 diff --git a/changelog/unreleased/kong/11625.yml b/changelog/unreleased/kong/on_prem_dp_metadata.yml similarity index 78% rename from changelog/unreleased/kong/11625.yml rename to changelog/unreleased/kong/on_prem_dp_metadata.yml index e4b14f81e2e..0540c597678 100644 --- a/changelog/unreleased/kong/11625.yml +++ b/changelog/unreleased/kong/on_prem_dp_metadata.yml @@ -1,7 +1,3 @@ "message": "**Clustering**: Allow configuring DP metadata labels for on-premise CP Gateway" "type": "feature" "scope": "Clustering" -"prs": -- 11625 -"jiras": -- "KAG-2444" diff --git a/changelog/unreleased/kong/wasm-filter-config-schemas.yml b/changelog/unreleased/kong/wasm-filter-config-schemas.yml index daaa21ff7f6..afaadc295b7 100644 --- a/changelog/unreleased/kong/wasm-filter-config-schemas.yml +++ b/changelog/unreleased/kong/wasm-filter-config-schemas.yml @@ -1,7 +1,3 @@ message: Add support for optional Wasm filter configuration schemas type: feature scope: Core -prs: - - 11568 -jiras: - - KAG-662