Skip to content

Commit f1d5362

Browse files
authored
Update api-surface-area-review-verification.yml to exclude non-java c… (#6180)
* Update api-surface-area-review-verification.yml to exclude non-java change and non-test change * Update changelog-verification.yml to only trigger java change
1 parent 9968114 commit f1d5362

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/api-surface-area-review-verification.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
types: [ opened, synchronize, reopened, labeled, unlabeled ]
1010
branches:
1111
- master
12+
paths:
13+
- '**/*.java'
1214

1315
jobs:
1416
api-surface-area-review-verification:
@@ -20,7 +22,7 @@ jobs:
2022
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-api-surface-area-change') }}
2123
run: |
2224
git fetch origin ${{ github.base_ref }} --depth 1
23-
FILES=$( git diff remotes/origin/${{ github.base_ref }} --name-only | grep "\.java$" | grep -v -E "(^|/)(internal|test|codegen|v2-migration)/" || true)
25+
FILES=$( git diff remotes/origin/${{ github.base_ref }} --name-only | grep "\.java$" | grep -v -E "(^|/)(internal|test|codegen|v2-migration|it)/" || true)
2426
if [ -n "$FILES" ]; then
2527
echo "::error::Changes around protected/public APIs found:"
2628
echo "$FILES" | while read file; do
@@ -37,4 +39,4 @@ jobs:
3739
echo "::error ::Change around public/protected APIs has been detected. Please either:"
3840
echo "::error ::* Review it with the team and add the 'api-surface-area-reviewed' label to this PR after approval –or–"
3941
echo "::error ::* Add the 'no-api-surface-area-change' label to this PR in case this is a false positive"
40-
exit 1
42+
exit 1

.github/workflows/changelog-verification.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
types: [ opened, synchronize, reopened, labeled, unlabeled ]
1010
branches:
1111
- master
12+
paths:
13+
- '**/*.java'
1214

1315
jobs:
1416
changelog-verification:
@@ -18,12 +20,21 @@ jobs:
1820
- name: Check for changelog entry
1921
if: ${{ !contains(github.event.pull_request.labels.*.name, 'changelog-not-required') }}
2022
run: |
21-
git fetch origin ${{ github.base_ref }} --depth 1 && \
22-
git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/next-release/*[a-zA-Z0-9_-]+\.json"
23+
git fetch origin ${{ github.base_ref }} --depth 1
24+
NON_TEST_FILES=$( git diff remotes/origin/${{ github.base_ref }} --name-only | grep "\.java$" | grep -v -E "(^|/)(test|it)/" || true)
25+
if [ -n "NON_TEST_FILES" ]; then
26+
echo "::error::Non-test Java change found:"
27+
echo "NON_TEST_FILES" | while read file; do
28+
echo "::error::$file"
29+
done
30+
git diff remotes/origin/${{ github.base_ref }} --name-only | grep -P "\.changes/next-release/*[a-zA-Z0-9_-]+\.json"
31+
else
32+
echo "No change that may require a changelog entry found."
33+
fi
2334
- name: Error message
2435
if: ${{ failure() }}
2536
run: |
2637
echo "::error ::No new/updated changelog entry found in /.changes/next-release directory. Please either:"
2738
echo "::error ::* Add a changelog entry (see CONTRIBUTING.md for instructions) –or–"
2839
echo "::error ::* Add the 'changelog-not-required' label to this PR (in rare cases not warranting a changelog entry)"
29-
exit 1
40+
exit 1

0 commit comments

Comments
 (0)