Create CODEOWNERS #234
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Changelog Checker | |
on: | |
pull_request: | |
types: [opened, synchronize, labeled, unlabeled] | |
branches: | |
- main | |
jobs: | |
changelog-check: | |
if: "!contains(github.event.pull_request.labels.*.name, 'pr/no-changelog')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 # by default the checkout action doesn't check out all branches | |
- name: Check for changelog entry in diff | |
run: | | |
# Check if there's a diff on CHANGELOG.md | |
changelog_diff=$(git --no-pager diff --name-only HEAD "$(git merge-base HEAD "origin/${{ github.event.pull_request.base.ref }}")" -- CHANGELOG.md) | |
if [ -z "$changelog_diff" ]; then | |
echo "Did not detect changes in CHANGELOG.md" | |
echo "If no changelog entry is needed, skip this check with the 'pr/no-changelog' label" | |
exit 1 | |
else | |
echo "Found changelog entry in PR!" | |
fi |