Skip to content

Commit

Permalink
add check to verify proper file modification
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed May 17, 2024
1 parent e0a90d6 commit 5e7db80
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,33 @@ jobs:
- name: Run Javadoc
run: ./gradlew javadoc

Verify-Api-Version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Checks to see if any change in any of the management API modules was done. If so, it sets the "mgmt" filter to "true"
- uses: dorny/[email protected]
id: filter
with:
filters: |
mgmt:
- 'extensions/control-plane/api/management-api/**/*.java'
# Use the filter to check if files in any of the management API modules were changed
# in the PR. If they were, check also, if the "api-version.json" file was appropriately modified

- name: Inspect changeset if version file changed
if: ${{ steps.filter.outputs.mgmt == 'true' }}
run: |
# check if changeset contains the `api-version.json` file
changes=$(git diff --name-only main | grep "api-version.json" | wc -l)
if [ $changes -lt 1 ]; then
echo "::error file=./extensions/common/api/management-api-configuration/src/main/resources/api-version.json,line=1::Bumping the version is required after a change to the Management API"
return 1;
fi

Unit-Tests:
runs-on: ubuntu-latest
env:
Expand Down

0 comments on commit 5e7db80

Please sign in to comment.