Skip to content
Latchkey

πŸš€ AutoPub PR Check workflow (strawberry-graphql/strawberry-django)

The πŸš€ AutoPub PR Check workflow from strawberry-graphql/strawberry-django, 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: strawberry-graphql/strawberry-django.github/workflows/pr.ymlLicense MITView source

What it does

This is the πŸš€ AutoPub PR Check workflow from the strawberry-graphql/strawberry-django repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

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

The workflow

workflow (.yml)
name: πŸš€ AutoPub PR Check

on:
  pull_request_target:
    branches: [main]

permissions:
  contents: read

jobs:
  check-release:
    name: πŸ“¦ Check for release
    if: github.event.pull_request.user.type != 'Bot'
    runs-on: ubuntu-latest
    outputs:
      has_release: ${{ steps.check.outputs.has_release }}

    steps:
      - uses: actions/checkout@v4
        with:
          ref: "refs/pull/${{ github.event.number }}/merge"
          sparse-checkout: |
            RELEASE.md
            pyproject.toml
          sparse-checkout-cone-mode: false

      - name: Check for release
        id: check
        uses: autopub/autopub-action@5fdc82e84c048a82303de6b5c5a9d027665e73cf # v1.1.1
        with:
          command: check
          autopub-version: "1.0.0a58"
          github-token: ${{ secrets.BOT_TOKEN }}
          fail-on-missing: "true"
          extra-plugins: strawberry-autopub-plugins

The same workflow, on Latchkey

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

name: πŸš€ AutoPub PR Check
 
on:
  pull_request_target:
    branches: [main]
 
permissions:
  contents: read
 
jobs:
  check-release:
    timeout-minutes: 30
    name: πŸ“¦ Check for release
    if: github.event.pull_request.user.type != 'Bot'
    runs-on: latchkey-small
    outputs:
      has_release: ${{ steps.check.outputs.has_release }}
 
    steps:
      - uses: actions/checkout@v4
        with:
          ref: "refs/pull/${{ github.event.number }}/merge"
          sparse-checkout: |
            RELEASE.md
            pyproject.toml
          sparse-checkout-cone-mode: false
 
      - name: Check for release
        id: check
        uses: autopub/autopub-action@5fdc82e84c048a82303de6b5c5a9d027665e73cf # v1.1.1
        with:
          command: check
          autopub-version: "1.0.0a58"
          github-token: ${{ secrets.BOT_TOKEN }}
          fail-on-missing: "true"
          extra-plugins: strawberry-autopub-plugins
 

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.

Actions used in this workflow