diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index d8c9764b30b..8aff19b4dc9 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -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/paths-filter@v3.0.2 + 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: