From a0fa5cb161860920282de82b373497ac597c7c2c Mon Sep 17 00:00:00 2001 From: Peter Shen Date: Thu, 22 Feb 2024 00:01:52 +0800 Subject: [PATCH] Update pre-commit.yml --- .github/workflows/pre-commit.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 1c8960d..9ef88cd 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -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: @@ -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: