Skip to content

Commit

Permalink
Update pre-commit.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxianpeng authored Feb 21, 2024
1 parent c1ec33f commit a0fa5cb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Run pre-commit

on:
workflow_call:
inputs:
commands:
required: false
type: string
default: ""
description: run additional commands for preparing the environment

jobs:
run-pre-commit:
Expand All @@ -12,8 +18,11 @@ jobs:
id: python-setup
with:
python-version: '3.x'
- name: Install dependencies
run: pip install pytest # pytest is often used as a local hook in .pre-commit-config.yaml
- name: Run commands
run: |
if [ ${{ inputs.commands }} != "" ]; then
${{ inputs.commands }}
fi
- name: Cache pre-commit environments
uses: actions/cache@v4
with:
Expand Down

0 comments on commit a0fa5cb

Please sign in to comment.