Skip to content

Commit

Permalink
fix: resolve pip install environment error (#25)
Browse files Browse the repository at this point in the history
Co-authored-by: Bryant Biggs <[email protected]>
  • Loading branch information
peter-mcconnell and bryantbiggs authored Oct 11, 2024
1 parent 58f4fa2 commit 8aef651
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.0
rev: v1.96.1
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand All @@ -23,7 +23,7 @@ repos:
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
Expand Down
16 changes: 15 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,11 @@ 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 8aef651

Please sign in to comment.