Skip to content

fix: pre-commit to skip mkinit in hook and only run on changed lines #35

fix: pre-commit to skip mkinit in hook and only run on changed lines

fix: pre-commit to skip mkinit in hook and only run on changed lines #35

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: "Pre-commit"
on:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get modified files
id: modified-files
run: echo "modified_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
make setup-venv
make setup-mkinit
- uses: pre-commit/action@v3.0.1
env:
SKIP: mkinit
with:
extra_args: >-
--from-ref ${{ github.event.pull_request.base.sha }}
--to-ref ${{ github.sha }}