Skip to content

Commit

Permalink
Update step for check breaking changes into github action
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Dec 15, 2023
1 parent ae403ab commit 466f321
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/release_open_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
branches:
- release-dev
types: [ opened ]
types: [ opened, synchronize, reopened ]
workflow_dispatch: #allow to run github action manually
permissions:
contents: write
Expand All @@ -13,42 +13,30 @@ jobs:
permissions: write-all
#if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Check out HEAD revision
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: ${{ github.head_ref }}
path: head
- name: Check out BASE revision
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: release-dev
path: base
- name: Build with Maven
run: mvn test -Dtest=SwaggerConfigTest#swaggerSpringPlugin -DfailIfNoTests=false
- name: Run OpenAPI Diff (from HEAD revision)
uses: LimeFlight/openapi-diff-action@master
uses: mvegter/openapi-diff-action@72cde50f8d3a75f770f08e23b815d5ebe69ff757
with:
head_spec: head/app/src/main/resources/swagger/api-docs.json
base_spec: base/app/src/main/resources/swagger/api-docs.json
output_path: ./output
github_token: ${{ github.token }}
- name: Check report diff
run: |
cd output
result=$(sed -n '/<span class="badge badge-Incompatible">/,/<\/span>/p' api-docs.html)
echo $result;
if [[ "$result" == *"Incompatible"* ]]; then
exit 1;
else
echo 'No incompatible differences between the two api docs';
fi
head-spec: head/app/src/main/resources/swagger/api-docs.json
base-spec: base/app/src/main/resources/swagger/api-docs.json
- name: Commit api-docs
run: |
git ls-files ./app** | grep 'api-docs*' | xargs git add
Expand Down

0 comments on commit 466f321

Please sign in to comment.