DEV Community

Cover image for Fail CI when a pull request adds a retired OpenAI or Anthropic model
Versyka
Versyka

Posted on AI-assisted

Fail CI when a pull request adds a retired OpenAI or Anthropic model

A retired AI model doesn't fail your tests, because your tests mock the LLM. It fails in production, the day after the shutdown date.

So check model IDs where you check everything else: on the pull request.

The workflow

.github/workflows/models.yml:

name: AI models
on: pull_request

jobs:
  models:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write   # for the PR comment
    steps:
      - uses: actions/checkout@v4
      - uses: versyka/versyka-action@v1
Enter fullscreen mode Exit fullscreen mode

That's it. No account, no API key.

What happens on a PR

  • A retired model (say gpt-4-0613): the check fails, and a comment on the PR says which file and line, and what to use instead.
  • A model retiring within 90 days: the check passes, with a heads-up in the comment.
  • Everything current: the check passes quietly.

The comment is updated in place on each push, so the PR doesn't fill up with bot messages.

Options

      - uses: versyka/versyka-action@v1
        with:
          fail-on: soon     # none | retired (default) | soon | behind
          days: 60          # how far ahead counts as "soon" (default 90)
          comment: true     # comment on the PR (default true)
          path: services/api  # folder to check, for monorepos (default .)
Enter fullscreen mode Exit fullscreen mode

fail-on: soon is useful the month before a big shutdown date: it turns the heads-up into a blocker.

Outputs

The step exposes retired, soon and behind as outputs, so you can branch on them:

      - id: models
        uses: versyka/versyka-action@v1
        with:
          fail-on: none
      - if: steps.models.outputs.soon != '0'
        run: echo "Models retiring soon: ${{ steps.models.outputs.soon }}"
Enter fullscreen mode Exit fullscreen mode

Where the dates come from

The same retirement data behind versyka.com/model-retirements, with dates from OpenAI, Anthropic, Google, Mistral, Cohere, AWS Bedrock, Azure, Groq and Together AI.

The action is on the GitHub Marketplace.

Top comments (0)