diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8a4bfe57..744dab41 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -46,7 +46,9 @@ jobs: name: Test Swagger runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 2 - uses: actions/setup-go@v4 with: go-version: '1.21' @@ -61,9 +63,10 @@ jobs: - name: Check breaking changes if: always() id: breaking - run: swagger diff --break <(git show HEAD~1:swaggerui/html/swagger.json --quiet) ./swaggerui/html/swagger.json > swagger_breaking_changes.txt + run: swagger diff --break <(git show HEAD~1:swaggerui/html/swagger.json --quiet) ./swaggerui/html/swagger.json > swagger_breaking_changes.txt - name: Add comment if: always() + needs: [breaking] uses: mshick/add-pr-comment@v2 with: message-id: breaking-comment