Skip to content
Latchkey

Update Graph Documentation πŸ¦œπŸ“š workflow (minitap-ai/mobile-use)

The Update Graph Documentation πŸ¦œπŸ“š workflow from minitap-ai/mobile-use, explained and optimized by Latchkey.

F

CI health: F - at risk

Point runs-on at Latchkey and get caching, run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: minitap-ai/mobile-use.github/workflows/update-graph-docs.ymlLicense Apache-2.0View source

What it does

This is the Update Graph Documentation πŸ¦œπŸ“š workflow from the minitap-ai/mobile-use repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

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

The workflow

workflow (.yml)
name: Update Graph Documentation πŸ¦œπŸ“š
on:
  pull_request:
    types: [opened, synchronize]
    branches: [main]
    paths:
      - "minitap/mobile_use/graph/graph.py"
  workflow_dispatch:

permissions:
  contents: write

jobs:
  update-docs:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v5
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          fetch-depth: 0
          ref: ${{ github.head_ref }}

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y graphviz graphviz-dev

      - name: Install uv
        uses: astral-sh/setup-uv@v6
        with:
          enable-cache: true

      - name: Install dependencies
        run: |
          uv sync

      - name: Generate graph documentation
        run: uv run python scripts/doc/generate_graph_docs.py

      - name: Check for changes
        id: changes
        run: |
          git add doc/graph.png
          if git diff --cached --quiet doc/graph.png; then
            echo "changed=false" >> $GITHUB_OUTPUT
          else
            echo "changed=true" >> $GITHUB_OUTPUT
          fi

      - name: Get last commit author
        if: steps.changes.outputs.changed == 'true'
        id: author
        run: |
          echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT
          echo "email=$(git log -1 --pretty=format:'%ae')" >> $GITHUB_OUTPUT

      - name: Commit and push changes
        if: steps.changes.outputs.changed == 'true'
        run: |
          git config --local user.email "${{ steps.author.outputs.email }}"
          git config --local user.name "${{ steps.author.outputs.name }}"
          git add doc/graph.png
          git commit -m "chore(doc): Update graph documentation [skip ci]"
          git push

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Update Graph Documentation πŸ¦œπŸ“š
on:
  pull_request:
    types: [opened, synchronize]
    branches: [main]
    paths:
      - "minitap/mobile_use/graph/graph.py"
  workflow_dispatch:
 
permissions:
  contents: write
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  update-docs:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - name: Checkout code
        uses: actions/checkout@v5
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          fetch-depth: 0
          ref: ${{ github.head_ref }}
 
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          cache: 'pip'
          python-version: "3.12"
 
      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y graphviz graphviz-dev
 
      - name: Install uv
        uses: astral-sh/setup-uv@v6
        with:
          enable-cache: true
 
      - name: Install dependencies
        run: |
          uv sync
 
      - name: Generate graph documentation
        run: uv run python scripts/doc/generate_graph_docs.py
 
      - name: Check for changes
        id: changes
        run: |
          git add doc/graph.png
          if git diff --cached --quiet doc/graph.png; then
            echo "changed=false" >> $GITHUB_OUTPUT
          else
            echo "changed=true" >> $GITHUB_OUTPUT
          fi
 
      - name: Get last commit author
        if: steps.changes.outputs.changed == 'true'
        id: author
        run: |
          echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT
          echo "email=$(git log -1 --pretty=format:'%ae')" >> $GITHUB_OUTPUT
 
      - name: Commit and push changes
        if: steps.changes.outputs.changed == 'true'
        run: |
          git config --local user.email "${{ steps.author.outputs.email }}"
          git config --local user.name "${{ steps.author.outputs.name }}"
          git add doc/graph.png
          git commit -m "chore(doc): Update graph documentation [skip ci]"
          git push
 

What changed

1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

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