Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
contents: read

jobs:
prek:
prek-audit:
name: Run prek
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
contents: read

jobs:
prek:
prek-manual:
name: Run prek
runs-on: ubuntu-latest
steps:
Expand Down
24 changes: 5 additions & 19 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,8 @@ permissions:
contents: read

jobs:
prek:
name: 🏃🏼 prek on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.11
- name: Run standard prek hooks
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
with:
extra-args: '--all-files'
prek-standard:
uses: ./.github/workflows/reusable-prek.yml
with:
skip_hooks: 'yamllint'
Comment thread
jbampton marked this conversation as resolved.
Outdated
extra_args: '--all-files --verbose'
42 changes: 42 additions & 0 deletions .github/workflows/reusable-prek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Reusable prek

on:
workflow_call:
inputs:
extra_args:
description: 'Arguments to pass to the prek command'
required: false
type: string
default: '--all-files'
skip_hooks:
description: 'Comma-separated list of hooks to skip'
required: false
type: string
default: ''

Comment thread
jbampton marked this conversation as resolved.
jobs:
prek:
name: 🏃🏼 prek on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.11

- name: Run standard prek hooks
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
# We use a conditional env variable to handle the SKIP logic
env:
SKIP: ${{ (matrix.os == 'windows-latest' && inputs.skip_hooks != '') && inputs.skip_hooks || '' }}
with:
extra-args: ${{ inputs.extra_args }}
Loading