diff --git a/.github/workflows/api-surface-area-review-verification.yml b/.github/workflows/api-surface-area-review-verification.yml index b652db2559d..f65e30c758d 100644 --- a/.github/workflows/api-surface-area-review-verification.yml +++ b/.github/workflows/api-surface-area-review-verification.yml @@ -9,6 +9,8 @@ on: types: [ opened, synchronize, reopened, labeled, unlabeled ] branches: - master + paths: + - '**/*.java' jobs: api-surface-area-review-verification: @@ -20,7 +22,7 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-api-surface-area-change') }} run: | git fetch origin ${{ github.base_ref }} --depth 1 - FILES=$( git diff remotes/origin/${{ github.base_ref }} --name-only | grep "\.java$" | grep -v -E "(^|/)(internal|test|codegen|v2-migration)/" || true) + FILES=$( git diff remotes/origin/${{ github.base_ref }} --name-only | grep "\.java$" | grep -v -E "(^|/)(internal|test|codegen|v2-migration|it)/" || true) if [ -n "$FILES" ]; then echo "::error::Changes around protected/public APIs found:" echo "$FILES" | while read file; do @@ -37,4 +39,4 @@ jobs: echo "::error ::Change around public/protected APIs has been detected. Please either:" echo "::error ::* Review it with the team and add the 'api-surface-area-reviewed' label to this PR after approval –or–" echo "::error ::* Add the 'no-api-surface-area-change' label to this PR in case this is a false positive" - exit 1 \ No newline at end of file + exit 1 diff --git a/.github/workflows/changelog-verification.yml b/.github/workflows/changelog-verification.yml index b6f35ea36c6..111ebf18a4c 100644 --- a/.github/workflows/changelog-verification.yml +++ b/.github/workflows/changelog-verification.yml @@ -9,6 +9,8 @@ on: types: [ opened, synchronize, reopened, labeled, unlabeled ] branches: - master + paths: + - '**/*.java' jobs: changelog-verification: @@ -18,12 +20,21 @@ jobs: - 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 && \ - git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/next-release/*[a-zA-Z0-9_-]+\.json" + 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 \ No newline at end of file + exit 1