diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml new file mode 100644 index 000000000..56bec01ce --- /dev/null +++ b/.github/workflows/changelog-requirement.yml @@ -0,0 +1,33 @@ +name: Changelog Requirement + +on: + pull_request: + types: [ opened, synchronize, labeled, unlabeled ] + paths: + - 'gateway/**' + +jobs: + require-changelog: + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changelog') }} + name: Requires changelog + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Find changelog files + id: changelog-file + uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47 + with: + # Avoid using single or double quotes for multiline patterns + files: | + CHANGELOG.md + + - name: Check changelog existence + if: steps.changelog-file.outputs.any_changed == 'false' + run: | + echo "Please include a CHANGELOG entry. You can find it at [CHANGELOG.md](https://github.com/3scale/apicast/blob/master/CHANGELOG.md)." + echo "Note, we hard-wrap at 80 chars and use 2 spaces after the last line." + echo "If you believe this PR requires no changelog entry, label it with \"skip-changelog\"." + exit 1