suky
Docs

GitHub Actions (CI)

suky ships your contracts to CI as ODCS (Open Data Contract Standard) YAML. A workflow bundles the contract files in your repo and posts them to the github-ci-check function, which classifies every proposed change as breaking, additive, or cosmetic and fails the pull request on breaking changes.

Setup

  1. Generate a workspace API key in Settings → Security and add it as a repository secret named SUKY_API_KEY. Add your suky API host as a repository variable SUPABASE_URL.
  2. Run npx suky init in your repo — it scaffolds a contracts/ folder and .github/workflows/suky-contract-check.yml.
name: suky contract check
on:
  pull_request:
    paths: ['contracts/**/*.odcs.yaml']

jobs:
  contract-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Call suky github-ci-check
        env:
          SUKY_API_KEY: ${{ secrets.SUKY_API_KEY }}
          SUPABASE_URL: ${{ vars.SUPABASE_URL }}
        run: |
          RESP=$(jq -Rs --arg repo "${{ github.repository }}" \
              --argjson pr ${{ github.event.pull_request.number }} \
              --arg sha "${{ github.event.pull_request.head.sha }}" \
              '{ repo: $repo, pr_number: $pr, commit_sha: $sha,
                 proposed_contracts_yaml: . }' contracts/*.odcs.yaml |
            curl -sS -X POST "$SUPABASE_URL/functions/v1/github-ci-check" \
              -H "Authorization: Bearer $SUKY_API_KEY" \
              -H "Content-Type: application/json" -d @-)
          echo "$RESP" | jq .
          test "$(echo "$RESP" | jq -r '.status')" = "passed"

Condensed for readability — npx suky init writes the full workflow (multi-file bundling with --- separators and an empty-bundle guard) for you.

What it checks

  • Each proposed contract change is classified as breaking, additive, or cosmetic against the active contract.
  • The workflow fails the job when the response status isn't passed — a breaking change (e.g. a removed event or a property type change) blocks the merge; additive and cosmetic changes pass.
  • With the suky GitHub App installed, the check result is also reported back on the pull request.