diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml new file mode 100644 index 000000000000..7bbc02a32a38 --- /dev/null +++ b/.github/workflows/changelog-requirement.yml @@ -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 diff --git a/.github/workflows/changelog-validation.yml b/.github/workflows/changelog-validation.yml new file mode 100644 index 000000000000..7590fca8928d --- /dev/null +++ b/.github/workflows/changelog-validation.yml @@ -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