-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from bschaatsbergen/add-checkov
feat: add checkov
- Loading branch information
Showing
3 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: precommit | ||
on: | ||
pull_request: | ||
permissions: | ||
contents: read | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
precommit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Create virtual environment | ||
run: python3 -m venv venv && source venv/bin/activate | ||
- name: Install pre-commit and checkov | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install pre-commit==3.5.0 checkov==2.5.10 | ||
- name: install terraform-docs | ||
run: | | ||
curl -sSLo ./terraform-docs.tar.gz https://terraform-docs.io/dl/v0.16.0/terraform-docs-v0.16.0-$(uname)-amd64.tar.gz | ||
tar -xzf terraform-docs.tar.gz | ||
chmod +x terraform-docs | ||
mv terraform-docs /usr/local/bin/ | ||
- name: Cache packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Run pre-commit | ||
run: pre-commit run --show-diff-on-failure --color=always --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters