diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1896f91e..08e3f551a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,10 +32,7 @@ jobs: generate-spec: runs-on: ubuntu-latest steps: - - name: fetch history - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v3 @@ -46,18 +43,17 @@ jobs: - name: Install Mage run: go install github.com/magefile/mage - - name: Update to latest spec - shell: bash - run: | - export PATH=$PATH:$(go env GOPATH)/bin - go install github.com/swaggo/swag/cmd/swag@v1.8.7 - mage spec - - - name: Push generated spec file + - name: Update spec and push generated spec file uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - run: | - git config --global user.name "${GITHUB_ACTOR}" - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + export PATH=$PATH:$(go env GOPATH)/bin + mage spec + git config user.name github-actions + git config user.email github-actions@github.com if (git diff --shortstat | grep '[0-9]'); then \ git add .; \ git commit -m "gen OpenAPI Spec by github-actions"; \ diff --git a/magefile.go b/magefile.go index d65c4fd55..f076ccdde 100644 --- a/magefile.go +++ b/magefile.go @@ -108,7 +108,11 @@ func Integration() error { // Spec generates an OpenAPI spec yaml based on code annotations. func Spec() error { swagCommand := "swag" - if err := installIfNotPresent(swagCommand, "github.com/swaggo/swag/cmd/swag@latest"); err != nil { + if err := installIfNotPresent(swagCommand, "github.com/swaggo/swag/cmd/swag@v1.8.7"); err != nil { + logrus.Fatal(err) + return err + } + if err := sh.Run(swagCommand, "fmt", "-d", "pkg/server/router"); err != nil { logrus.Fatal(err) return err } diff --git a/pkg/server/router/presentation.go b/pkg/server/router/presentation.go index 0e5097bc5..3dc6b2a01 100644 --- a/pkg/server/router/presentation.go +++ b/pkg/server/router/presentation.go @@ -374,7 +374,7 @@ type ReviewSubmissionResponse struct { } // ReviewSubmission godoc -// @Summary Review a pending submissions +// @Summary Review a pending submission // @Description Reviews a pending submission. After this method is called, the operation with `id==presentations/submissions/{submission_id}` will be updated with the result of this invocation. // @Tags SubmissionAPI // @Accept json