Skip to content
Latchkey

AI Moderator workflow (appwrite/appwrite)

The AI Moderator workflow from appwrite/appwrite, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: appwrite/appwrite.github/workflows/ai-moderator.ymlLicense BSD-3-ClauseView source

What it does

This is the AI Moderator workflow from the appwrite/appwrite repository, a real project running GitHub Actions. It is shown here with attribution under its BSD-3-Clause license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: AI Moderator

on:
  issues:
    types: [opened, edited]
  issue_comment:
    types: [created, edited]
  pull_request_review:
    types: [submitted, edited]
  pull_request_review_comment:
    types: [created, edited]
  discussion:
    types: [created, edited]
  discussion_comment:
    types: [created, edited]

permissions:
  models: read
  issues: write
  pull-requests: write
  discussions: write

jobs:
  moderate:
    runs-on: ubuntu-latest
    steps:
      - name: AI Moderator
        uses: github/ai-moderator@81159c370785e295c97461ade67d7c33576e9319 # v1.1.4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: AI Moderator
 
on:
  issues:
    types: [opened, edited]
  issue_comment:
    types: [created, edited]
  pull_request_review:
    types: [submitted, edited]
  pull_request_review_comment:
    types: [created, edited]
  discussion:
    types: [created, edited]
  discussion_comment:
    types: [created, edited]
 
permissions:
  models: read
  issues: write
  pull-requests: write
  discussions: write
 
jobs:
  moderate:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - name: AI Moderator
        uses: github/ai-moderator@81159c370785e295c97461ade67d7c33576e9319 # v1.1.4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.