Skip to content
Closed
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
49 changes: 49 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: pre-commit

on:
pull_request:

permissions:
contents: read
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

concurrency:
group: pre-commit-${{ github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
CGO_ENABLED: "0"
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
tools/go.sum

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"

- name: Install pre-commit
run: python -m pip install pre-commit==4.6.2

- name: Generate ignored Go sources where required
run: |
if grep -q '^generate-all:' Makefile; then
make generate-all
fi

# This runs pre-commit-stage hooks; PR-title validation stays in Prow.
- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure