Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(actions): enforce new changelog format and convention #11757

Merged
merged 13 commits into from
Oct 17, 2023
51 changes: 43 additions & 8 deletions .github/workflows/changelog-requirement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- 'kong/**'
- '**.rockspec'
- '.requirements'
- 'changelog/**'

jobs:
require-changelog:
Expand All @@ -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
4 changes: 0 additions & 4 deletions changelog/unreleased/kong/fix_patch_order.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
message: fix the building failure when applying patches
type: bugfix
scope: Core
prs:
- 11696
jiras:
- KAG-2712
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 0 additions & 4 deletions changelog/unreleased/kong/wasm-filter-config-schemas.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
message: Add support for optional Wasm filter configuration schemas
type: feature
scope: Core
prs:
- 11568
jiras:
- KAG-662