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

The optimized version below adds job timeouts.

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

  • Run on Latchkey managed runners with one line (runs-on), which apply the fixes below automatically and self-heal transient failures. This example uses latchkey-small; pick the runner size that fits the job.
  • Add a job timeout so a hung step cannot burn hours of runner time.

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

Actions used in this workflow

github/ai-moderator

Frequently asked questions

What does the AI Moderator workflow (appwrite/appwrite) workflow do?
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.
What CI health grade does this workflow get?
This Automation and other workflow grades A. Paste your own workflow into the Latchkey grader to see its grade and the exact fixes.
How can I improve this Automation and other workflow?
Apply job timeouts. Latchkey applies these automatically on managed runners when you point runs-on at Latchkey.

References