| 1 | name: apidiff |
| 2 | on: |
| 3 | push: |
| 4 | branches: [ "main" ] |
| 5 | pull_request: |
| 6 | branches: [ "main" ] |
| 7 | |
| 8 | jobs: |
| 9 | go-apidiff: |
| 10 | name: go-apidiff |
| 11 | runs-on: ubuntu-latest |
| 12 | if: github.event_name == 'pull_request' |
| 13 | steps: |
| 14 | - uses: actions/checkout@v6 |
| 15 | with: |
| 16 | fetch-depth: 0 |
| 17 | |
| 18 | - uses: actions/setup-go@v6 |
| 19 | with: |
| 20 | go-version-file: go.mod |
| 21 | |
| 22 | - name: Run go-apidiff |
| 23 | id: apidiff |
| 24 | continue-on-error: true |
| 25 | uses: joelanford/go-apidiff@main |
| 26 | |
| 27 | - name: Create apidiff.json |
| 28 | run: | |
| 29 | echo '{"id": ${{ github.event.pull_request.number }}, "semver-type": "${{ steps.apidiff.outputs.semver-type }}"}' > apidiff.json |
| 30 | |
| 31 | - name: Upload apidiff.json |
| 32 | uses: actions/upload-artifact@v7 |
| 33 | with: |
| 34 | name: apidiff |
| 35 | path: apidiff.json |