Skip to content
Latchkey

Latest Changes workflow (tiangolo/uvicorn-gunicorn-fastapi-docker)

The Latest Changes workflow from tiangolo/uvicorn-gunicorn-fastapi-docker, 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: tiangolo/uvicorn-gunicorn-fastapi-docker.github/workflows/latest-changes.ymlLicense MITView source

What it does

This is the Latest Changes workflow from the tiangolo/uvicorn-gunicorn-fastapi-docker 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: Latest Changes
on:
  pull_request_target: # zizmor: ignore[dangerous-triggers]
    branches:
      - master
    types:
      - closed
  workflow_dispatch:
    inputs:
      number:
        description: PR number
        required: true
jobs:
  latest-changes:
    permissions:
      contents: write
      pull-requests: read
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
        with:
          ref: ${{ github.event.repository.default_branch }}
          # To allow latest-changes to commit to master
          token: ${{ secrets.UVICORN_GUNICORN_FASTAPI_DOCKER_LATEST_CHANGES }} # zizmor: ignore[secrets-outside-env]
          persist-credentials: true # required by tiangolo/latest-changes
      - uses: tiangolo/latest-changes@c9b73efbc8992ef1a401e4235ea307a8ca8a724b # 0.6.1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          latest_changes_file: release-notes.md
          latest_changes_header: '## Latest Changes'
          end_regex: '^## .*'
          label_header_prefix: '### '

The same workflow, on Latchkey

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

name: Latest Changes
on:
  pull_request_target: # zizmor: ignore[dangerous-triggers]
    branches:
      - master
    types:
      - closed
  workflow_dispatch:
    inputs:
      number:
        description: PR number
        required: true
jobs:
  latest-changes:
    timeout-minutes: 30
    permissions:
      contents: write
      pull-requests: read
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
        with:
          ref: ${{ github.event.repository.default_branch }}
          # To allow latest-changes to commit to master
          token: ${{ secrets.UVICORN_GUNICORN_FASTAPI_DOCKER_LATEST_CHANGES }} # zizmor: ignore[secrets-outside-env]
          persist-credentials: true # required by tiangolo/latest-changes
      - uses: tiangolo/latest-changes@c9b73efbc8992ef1a401e4235ea307a8ca8a724b # 0.6.1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          latest_changes_file: release-notes.md
          latest_changes_header: '## Latest Changes'
          end_regex: '^## .*'
          label_header_prefix: '### '
 

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