Skip to content

Commit

Permalink
chore(changelog): use reusable changelog workflow (#11549)
Browse files Browse the repository at this point in the history
This avoids code duplication and makes improvements on changelog generation/format easier.
  • Loading branch information
vm-001 authored and Hans Hübner committed Sep 27, 2023
1 parent c666b5e commit 2489202
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/changelog-requirement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Changelog Requirement

on:
pull_request:
types: [ opened, synchronize, labeled, unlabeled ]
paths:
- 'kong/**'
- '**.rockspec'
- '.requirements'

jobs:
require-changelog:
if: ${{ !contains(github.event.*.labels.*.name, 'skip-changelog') }}
name: Requires changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: computes changed files
id: changelog-check
uses: tj-actions/changed-files@2f7246cb26e8bb6709b6cbfc1fec7febfe82e96a # v37
with:
files: 'CHANGELOG/unreleased/**/*.yaml'

- name: asserts changelog added
run: >
if [ "${{ steps.changelog-check.outputs.added_files_count }}" = "0" ]; then
echo "Should contain at least one changelog file in CHANGELOG/unreleased/*/ directory"
exit 1
fi
17 changes: 17 additions & 0 deletions .github/workflows/changelog-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Changelog Validation

on:
pull_request:
types: [ opened, synchronize ]

jobs:
validate-changelog:
name: Validate changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Validate changelogs
uses: Kong/gateway-changelog@main
with:
files: CHANGELOG/unreleased/*/*.yaml

0 comments on commit 2489202

Please sign in to comment.