Latitude 10 docs

The GitHub Action

Our Action for GitHub workflows scores your document in the workflow, can fail the job on a low score or a breaking change, and can push the version to the registry. It's public, under MIT.

1. Add the key

Add your project key to the repository's secrets as LATITUDE10_KEY. The Action scores and gates without it; pushing and fixes need it.

2. Add the step

- uses: jorgeortega/latitude10-action@v1
  with:
    spec: openapi.yaml
    min-score: 70          # fail below this; default: report only
    max-tools: 40          # fail above this many operations; default 40
    fail-on-breaking: true # default false
    push: ${{ github.ref == 'refs/heads/main' }}
    suggest-fixes: true    # paid plans; opens or updates one PR
  env:
    LATITUDE10_KEY: ${{ secrets.LATITUDE10_KEY }}   # optional

Inputs

InputWhat it doesDefault
specThe path to your OpenAPI document, YAML or JSON. Local $refs are bundled. Required.None
min-scoreFail when the readiness score is below this, from 0 to 100.Empty: report only
max-toolsFail when the document has more operations than this, since each one becomes an agent tool.40
fail-on-breakingFail when the document has breaking changes against its base.false
pushWith LATITUDE10_KEY, push this version to the registry.false
suggest-fixesWith LATITUDE10_KEY on a paid plan, open or update one pull request with rules-only fixes.false
labelThe version's label in the registry.Empty: info.version
github-tokenThe token for the fixes pull request. It needs contents and pull-requests write.The workflow's token
api-urlThe Latitude 10 API.https://latitude10.tech

Outputs

OutputWhat it holds
scoreThe readiness score, from 0 to 100.
operationsThe number of operations.
breakingThe breaking changes against the base.
version-urlWith push, the version's page in the registry.

The Action has no input for docs yet. Push a docs folder with curl from a step of its own.

Without the Action

One curl step pushes the document on every merge to main:

- name: Push the spec to Latitude 10
  if: github.ref == 'refs/heads/main'
  run: >
    curl --fail-with-body -X POST
    "https://latitude10.tech/api/registry/v1/versions?git_sha=$GITHUB_SHA&git_ref=$GITHUB_REF"
    -H "Authorization: Bearer $LATITUDE10_KEY"
    --data-binary @openapi.yaml
  env:
    LATITUDE10_KEY: ${{ secrets.LATITUDE10_KEY }}

Push a version lists what it answers.

Where this comes from

  • app/registry/_lib/ci.ts
  • app/api/registry/v1/versions/route.ts
  • app/registry/_lib/versions.ts
  • app/registry/_lib/bundle.ts
  • app/registry/_lib/usage.ts