Skip to content
Latchkey

reviewdog workflow (x-motemen/ghq)

The reviewdog workflow from x-motemen/ghq, 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: x-motemen/ghq.github/workflows/reviewdog.yamlLicense MITView source

What it does

This is the reviewdog workflow from the x-motemen/ghq 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: reviewdog
on: [pull_request]

permissions:
  contents: read
  pull-requests: write
jobs:
  typos:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    name: Spell Check with Typos
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
      with:
        persist-credentials: false
    - uses: crate-ci/typos@bee27e3a4fd1ea2111cf90ab89cd076c870fce14 # v1.48.0

  staticcheck:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    name: staticcheck
    runs-on: ubuntu-latest
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      - name: staticcheck
        uses: reviewdog/action-staticcheck@564f18c6297af36f7b10b6c7a72e814341bd813a # v1.29.0
        with:
          reporter: github-pr-review
          level: warning

  misspell:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    name: misspell
    runs-on: ubuntu-latest
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      - name: misspell
        uses: reviewdog/action-misspell@d6429416b12b09b4e2768307d53bef58d172e962 # v1.27.0
        with:
          reporter: github-pr-review
          level: warning
          locale: "US"

  actionlint:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      - uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1.72.0
        with:
          reporter: github-pr-review

The same workflow, on Latchkey

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

name: reviewdog
on: [pull_request]
 
permissions:
  contents: read
  pull-requests: write
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  typos:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    name: Spell Check with Typos
    runs-on: latchkey-small
    steps:
    - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
      with:
        persist-credentials: false
    - uses: crate-ci/typos@bee27e3a4fd1ea2111cf90ab89cd076c870fce14 # v1.48.0
 
  staticcheck:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    name: staticcheck
    runs-on: latchkey-small
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      - name: staticcheck
        uses: reviewdog/action-staticcheck@564f18c6297af36f7b10b6c7a72e814341bd813a # v1.29.0
        with:
          reporter: github-pr-review
          level: warning
 
  misspell:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    name: misspell
    runs-on: latchkey-small
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      - name: misspell
        uses: reviewdog/action-misspell@d6429416b12b09b4e2768307d53bef58d172e962 # v1.27.0
        with:
          reporter: github-pr-review
          level: warning
          locale: "US"
 
  actionlint:
    permissions:
      contents: read
      pull-requests: write
    timeout-minutes: 10
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      - uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1.72.0
        with:
          reporter: github-pr-review
 

What changed

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

Actions used in this workflow