Skip to content

Commit 8aef651

Browse files
peter-mcconnellbryantbiggs
andauthoredOct 11, 2024··
fix: resolve pip install environment error (#25)
Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
1 parent 58f4fa2 commit 8aef651

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed
 

‎.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.88.0
3+
rev: v1.96.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.5.0
26+
rev: v5.0.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

‎pre-commit/action.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,16 @@ runs:
6767
sudo unzip -qq terraform_${{ inputs.terraform-version }}_${{ env.OS }}_${{ env.ARCH }}.zip terraform -d /usr/bin/
6868
rm terraform_${{ inputs.terraform-version }}_${{ env.OS }}_${{ env.ARCH }}.zip 2> /dev/null
6969
70+
- name: Setup python venv
71+
shell: bash
72+
run: |
73+
mkdir -p ~/.venv
74+
python3 -m venv ~/.venv
75+
7076
- name: Install pre-commit dependencies
7177
shell: bash
7278
run: |
79+
source ~/.venv/bin/activate
7380
pip install -q pre-commit
7481
7582
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
@@ -99,4 +106,11 @@ runs:
99106
100107
- name: Execute pre-commit
101108
shell: bash
102-
run: pre-commit run ${{ inputs.args }}
109+
run: |
110+
source ~/.venv/bin/activate
111+
pre-commit run ${{ inputs.args }}
112+
113+
- name: Cleanup venv
114+
shell: bash
115+
run: |
116+
rm -rf .venv # tidy up

0 commit comments

Comments
 (0)
Please sign in to comment.