Fix comments that are different from the action #435
Workflow file for this run
This file contains hidden or 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 verification | |
permissions: | |
contents: read | |
pull-requests: read | |
on: | |
pull_request: | |
types: [ opened, synchronize, reopened, labeled, unlabeled ] | |
branches: | |
- master | |
paths: | |
- '**/*.java' | |
jobs: | |
changelog-verification: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for changelog entry | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'changelog-not-required') }} | |
run: | | |
git fetch origin ${{ github.base_ref }} --depth 1 | |
NON_TEST_FILES=$( git diff remotes/origin/${{ github.base_ref }} --name-only | grep "\.java$" | grep -v -E "(^|/)(test|it)/" || true) | |
if [ -n "NON_TEST_FILES" ]; then | |
echo "::error::Non-test Java change found:" | |
echo "NON_TEST_FILES" | while read file; do | |
echo "::error::$file" | |
done | |
git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/next-release/*[a-zA-Z0-9_-]+\.json" | |
else | |
echo "No change that may require a changelog entry found." | |
fi | |
- name: Error message | |
if: ${{ failure() }} | |
run: | | |
echo "::error ::No new/updated changelog entry found in /.changes/next-release directory. Please either:" | |
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–" | |
echo "::error ::* Add the 'changelog-not-required' label to this PR (in rare cases not warranting a changelog entry)" | |
exit 1 |