diff --git a/.github/scripts/auto-swagger.sh b/.github/scripts/auto-swagger.sh new file mode 100644 index 00000000..3a36349a --- /dev/null +++ b/.github/scripts/auto-swagger.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +{ +go install github.com/swaggo/swag/cmd/swag@latest +swag init -g ./cmd/server/main.go +git config user.name devops +git config suer.email devops@aastar.xyz +git add . +git commit -m "swagger updated" +git push +} || { +set -e +} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 43fd7267..7ceab15a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: @@ -21,5 +21,9 @@ jobs: run: go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./... - name: Test run: go test -v ./... + - name: Swagger + run: chmod +x ./.github/scripts/auto-swagger.sh && ./.github/scripts/auto-swagger.sh + + name: Building And Testing