| 1 |
name: APIDiff |
| 2 |
|
| 3 |
# Trigger the workflow on pull requests and direct pushes to any branch |
| 4 |
on: |
| 5 |
push: |
| 6 |
pull_request: |
| 7 |
|
| 8 |
jobs: |
| 9 |
go-apidiff: |
| 10 |
name: Verify API differences |
| 11 |
runs-on: ubuntu-latest |
| 12 |
# Pull requests from different repository only trigger this checks |
| 13 |
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) |
| 14 |
steps: |
| 15 |
- name: Clone the code |
| 16 |
uses: actions/checkout@v6 |
| 17 |
with: |
| 18 |
fetch-depth: 0 |
| 19 |
- name: Setup Go |
| 20 |
uses: actions/setup-go@v6 |
| 21 |
with: |
| 22 |
go-version-file: go.work |
| 23 |
- name: Execute go-apidiff |
| 24 |
uses: joelanford/[email protected] |
| 25 |
with: |
| 26 |
compare-imports: true |
| 27 |
print-compatible: true |
| 28 |
- name: Report failure |
| 29 |
uses: nashmaniac/[email protected] |
| 30 |
# Only report failures of pushes (PRs have are visible through the Checks section) to the default branch |
| 31 |
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 32 |
with: |
| 33 |
title: 🐛 go-apidiff failed for ${{ github.sha }} |
| 34 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 35 |
labels: kind/bug |
| 36 |
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |