From 05a88ffe40cc659b368427475f07a81c899d2de4 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Mon, 14 Oct 2024 07:53:43 +0000 Subject: [PATCH 1/3] use virtual environment --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 7a1823d..75eeb48 100644 --- a/action.yml +++ b/action.yml @@ -43,6 +43,8 @@ runs: # https://github.com/pypa/setuptools/issues/3269 export DEB_PYTHON_INSTALL_LAYOUT=deb fi + python3 -m venv venv + source venv/bin/activate python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt" - name: Run commit-check shell: bash From 3c999b7aa652550815821c7cf2d44475e175f19a Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Mon, 14 Oct 2024 08:00:21 +0000 Subject: [PATCH 2/3] fix: FileNotFoundError of commit-check --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 75eeb48..66fa984 100644 --- a/action.yml +++ b/action.yml @@ -48,7 +48,7 @@ runs: python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt" - name: Run commit-check shell: bash - run: python3 ${{ github.action_path }}/main.py + run: python3 "$GITHUB_ACTION_PATH/main.py" env: MESSAGE: ${{ inputs.message }} BRANCH: ${{ inputs.branch }} From 8287a1132cfcd9511e7bf231e436834cc980c556 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Mon, 14 Oct 2024 08:03:29 +0000 Subject: [PATCH 3/3] fix: merge two step to one step --- action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 66fa984..833ba66 100644 --- a/action.yml +++ b/action.yml @@ -36,7 +36,7 @@ inputs: runs: using: "composite" steps: - - name: Install action dependencies + - name: Install dependencies and run commit-check shell: bash run: | if [[ "$RUNNER_OS" == "Linux" ]]; then @@ -46,9 +46,7 @@ runs: python3 -m venv venv source venv/bin/activate python3 -m pip install -r "$GITHUB_ACTION_PATH/requirements.txt" - - name: Run commit-check - shell: bash - run: python3 "$GITHUB_ACTION_PATH/main.py" + python3 "$GITHUB_ACTION_PATH/main.py" env: MESSAGE: ${{ inputs.message }} BRANCH: ${{ inputs.branch }}