Skip to content
Latchkey

Lint pull request title workflow (vercel/turbo)

The Lint pull request title workflow from vercel/turbo, explained and optimized by Latchkey.

A

CI health: A - excellent

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

Grade your own workflow free or run it on Latchkey →
Source: vercel/turbo.github/workflows/lint-pr-title.ymlLicense MITView source

What it does

This is the Lint pull request title workflow from the vercel/turbo 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: Lint pull request title

env:
  TURBO_TELEMETRY_MESSAGE_DISABLED: "1"

on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize
      - reopened

permissions:
  pull-requests: read

jobs:
  main:
    name: Validate PR title
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          # Configure which types are allowed (newline-delimited).
          types: |
            fix
            feat
            chore
            ci
            docs
            refactor
            perf
            test
            style
            examples
          # Scopes are not allowed.
          scopes: ""
          # Configure additional validation for the subject based on a regex.
          # Ensures that the subject starts with an uppercase character.
          subjectPattern: ^[A-Z].*$
          # If `subjectPattern` is configured, you can use this property to override
          # the default error message that is shown when the pattern doesn't match.
          # The variables `subject` and `title` can be used within the message.
          subjectPatternError: |
            The subject "{subject}" found in the pull request title "{title}" doesn't match the configured pattern.
            Please ensure that the subject starts with an uppercase character.

The same workflow, on Latchkey

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

name: Lint pull request title
 
env:
  TURBO_TELEMETRY_MESSAGE_DISABLED: "1"
 
on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize
      - reopened
 
permissions:
  pull-requests: read
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  main:
    name: Validate PR title
    runs-on: latchkey-small
    timeout-minutes: 15
    steps:
      - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          # Configure which types are allowed (newline-delimited).
          types: |
            fix
            feat
            chore
            ci
            docs
            refactor
            perf
            test
            style
            examples
          # Scopes are not allowed.
          scopes: ""
          # Configure additional validation for the subject based on a regex.
          # Ensures that the subject starts with an uppercase character.
          subjectPattern: ^[A-Z].*$
          # If `subjectPattern` is configured, you can use this property to override
          # the default error message that is shown when the pattern doesn't match.
          # The variables `subject` and `title` can be used within the message.
          subjectPatternError: |
            The subject "{subject}" found in the pull request title "{title}" doesn't match the configured pattern.
            Please ensure that the subject starts with an uppercase character.
 

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