From 1c990895fee2f907f451ffe04166fdb8dc013957 Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Tue, 24 Mar 2026 10:26:45 -0700 Subject: [PATCH] feat(ci): analyze api changes --- .github/workflows/api-diff.yml | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/api-diff.yml diff --git a/.github/workflows/api-diff.yml b/.github/workflows/api-diff.yml new file mode 100644 index 0000000..4e794b4 --- /dev/null +++ b/.github/workflows/api-diff.yml @@ -0,0 +1,65 @@ +name: Analyze API Changes + +on: + push: + branches: + - main + pull_request: + +jobs: + changed-modules: + name: Determine Changed Modules + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + modules-json: ${{ steps.changed-modules.outputs.modules-json }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Changed modules + id: changed-modules + uses: smartcontractkit/.github/actions/changed-modules-go@changed-modules-go/v1 + with: + file-patterns: | + **/*.go + **/go.mod + **/go.sum + module-patterns: | + ** + + analyze-api-changes: + if: ${{ needs.changed-modules.outputs.modules-json != '[]' }} + name: Analyze (${{ matrix.module }}) + runs-on: ubuntu-latest + needs: changed-modules + permissions: + pull-requests: write + contents: read + strategy: + fail-fast: false + matrix: + module: ${{ fromJson(needs.changed-modules.outputs.modules-json) }} + steps: + - name: Checkout the repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: ${{ matrix.module }}/go.mod + cache: false + + - uses: smartcontractkit/.github/actions/apidiff-go@apidiff-go/v2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + module-directory: ${{ matrix.module }} + enforce-compatible: false + post-comment: true