-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add warning on breaking change to api
- Loading branch information
Showing
3 changed files
with
22 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ jobs: | |
- name: Go Vet | ||
run: go vet `go list ./... | grep -v "pkg/client"` | ||
test: | ||
name: Test | ||
name: Unit Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -46,7 +46,7 @@ jobs: | |
name: Test Swagger | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
|
@@ -55,24 +55,21 @@ jobs: | |
- name: Install Swagger | ||
run: go install github.com/go-swagger/go-swagger/cmd/[email protected] | ||
- name: Generate Swagger | ||
run: make swagger | ||
run: swagger generate spec -o ./swagger.json --scan-models --exclude-deps | ||
- name: Validate no changes | ||
run: git diff --exit-code ./swaggerui/html/swagger.json | ||
run: diff swagger.json ./swaggerui/html/swagger.json | ||
- name: Check breaking changes | ||
if: always() | ||
id: breaking | ||
run: | | ||
echo "diff=$(swagger diff --quiet --break <(git show HEAD~1:swaggerui/html/swagger.json) ./swaggerui/html/swagger.json)\n" >> $GITHUB_OUTPUT | ||
continue-on-error: true | ||
run: swagger diff --break <(git show master:swaggerui/html/swagger.json) swagger.json > /tmp/swagger_breaking_changes.txt | ||
- name: Add comment | ||
if: always() | ||
if: failure() && steps.breaking.outcome == 'failure' | ||
uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
Swagger have breaking changes: | ||
```text | ||
${{ steps.breaking.outputs.diff }} | ||
``` | ||
message-id: breaking-comment | ||
preformatted: true | ||
message-path: /tmp/swagger_breaking_changes.txt | ||
|
||
build: | ||
name: Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters