j178/prek-action

Run prek in your GitHub Actions workflows

105

stars

134

commits

TypeScript

primary language

Sep 2, 2026

updated

github.com/marketplace/actions/prek-actionBrowse cluster: Git Hooks and Pre-commit Tools

README

Prek Action

Run prek in your GitHub Actions workflows.

Usage

name: Prek checks
on: [push, pull_request]

jobs:
  prek:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6

prek is always invoked as:

prek run --show-diff-on-failure --color=always <extra-args>

Version Tags

For v2 and earlier releases, major and minor tags such as v2 and v2.0 are moving tags. Starting with v3, major and minor tags are no longer published. Always use an exact version such as j178/prek-action@v3.0.0; for stronger protection against supply-chain attacks, pin to a full commit SHA.

Inputs

InputDescriptionRequiredDefault
extra-argsAdditional arguments appended to prek run --show-diff-on-failure --color=alwaysNo--all-files
extra_argsDeprecated alias for extra-argsNo
prek-versionVersion or semver range to install, for example 0.2.30, 0.3.x, <=1.0.0, or latestNolatest
install-onlyInstall prek but skip prek runNofalse
working-directoryDirectory where prek run is executedNo.
show-verbose-logsPrint the prek verbose log after prek run completesNotrue
cacheCache the prek environment between workflow runsNotrue
tokenDeprecated and unused; retained for backward compatibilityNo''

Outputs

OutputDescription
prek-versionThe resolved prek version, normalized to a v-prefixed tag
cache-hitWhether the restored prek cache exactly matched the computed primary cache key

Examples

Install and run against all files:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6

Pass extra arguments:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      extra-args: '--all-files --directory packages/'

Pin a specific prek version:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      prek-version: '0.2.30'

Resolve a semver range:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      prek-version: '0.3.x'

Install only:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      install-only: true
  - run: prek run --show-diff-on-failure --color=always --all-files

Disable verbose log output after the run:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      show-verbose-logs: false

Requirements

The target repository needs a prek or pre-commit configuration file:

  • prek.toml
  • .pre-commit-config.yaml
  • .pre-commit-config.yml

Contributing

For contributor setup, testing, bundling, and release steps, see CONTRIBUTING.md.

Contributors

j178

68 commits

renovate[bot]

32 commits

shaanmajid

13 commits

Copilot

7 commits

j178/prek-action

Run prek in your GitHub Actions workflows

105

stars

134

commits

TypeScript

primary language

Sep 2, 2026

updated

github.com/marketplace/actions/prek-actionBrowse cluster: Git Hooks and Pre-commit Tools

README

Prek Action

Run prek in your GitHub Actions workflows.

Usage

name: Prek checks
on: [push, pull_request]

jobs:
  prek:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6

prek is always invoked as:

prek run --show-diff-on-failure --color=always <extra-args>

Version Tags

For v2 and earlier releases, major and minor tags such as v2 and v2.0 are moving tags. Starting with v3, major and minor tags are no longer published. Always use an exact version such as j178/prek-action@v3.0.0; for stronger protection against supply-chain attacks, pin to a full commit SHA.

Inputs

InputDescriptionRequiredDefault
extra-argsAdditional arguments appended to prek run --show-diff-on-failure --color=alwaysNo--all-files
extra_argsDeprecated alias for extra-argsNo
prek-versionVersion or semver range to install, for example 0.2.30, 0.3.x, <=1.0.0, or latestNolatest
install-onlyInstall prek but skip prek runNofalse
working-directoryDirectory where prek run is executedNo.
show-verbose-logsPrint the prek verbose log after prek run completesNotrue
cacheCache the prek environment between workflow runsNotrue
tokenDeprecated and unused; retained for backward compatibilityNo''

Outputs

OutputDescription
prek-versionThe resolved prek version, normalized to a v-prefixed tag
cache-hitWhether the restored prek cache exactly matched the computed primary cache key

Examples

Install and run against all files:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6

Pass extra arguments:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      extra-args: '--all-files --directory packages/'

Pin a specific prek version:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      prek-version: '0.2.30'

Resolve a semver range:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      prek-version: '0.3.x'

Install only:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      install-only: true
  - run: prek run --show-diff-on-failure --color=always --all-files

Disable verbose log output after the run:

steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6
    with:
      show-verbose-logs: false

Requirements

The target repository needs a prek or pre-commit configuration file:

  • prek.toml
  • .pre-commit-config.yaml
  • .pre-commit-config.yml

Contributing

For contributor setup, testing, bundling, and release steps, see CONTRIBUTING.md.

Contributors

j178

68 commits

renovate[bot]

32 commits

shaanmajid

13 commits

Copilot

7 commits

Languages

TypeScript

90.0%

JavaScript

10.0%