Skip to content

Commit

Permalink
fix: resolve pip install environment error
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mcconnell committed Oct 1, 2024
1 parent 58f4fa2 commit b509c15
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pre-commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ runs:
sudo unzip -qq terraform_${{ inputs.terraform-version }}_${{ env.OS }}_${{ env.ARCH }}.zip terraform -d /usr/bin/
rm terraform_${{ inputs.terraform-version }}_${{ env.OS }}_${{ env.ARCH }}.zip 2> /dev/null
- name: Setup python venv
shell: bash
run: |
mkdir -p ~/.venv
python3 -m venv ~/.venv
- name: Install pre-commit dependencies
shell: bash
run: |
source ~/.venv/bin/activate
pip install -q pre-commit
curl --retry 3 --retry-all-errors --retry-delay 3 -sSLo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/${{ inputs.terraform-docs-version }}/terraform-docs-${{ inputs.terraform-docs-version }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
Expand Down Expand Up @@ -99,4 +106,12 @@ runs:
- name: Execute pre-commit
shell: bash
run: pre-commit run ${{ inputs.args }}
run: |
source ~/.venv/bin/activate
pre-commit run ${{ inputs.args }}
- name: Cleanup venv
shell: bash
run: |
rm -rf .venv # tidy up

0 comments on commit b509c15

Please sign in to comment.