Skip to content

Commit

Permalink
feat: updated pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLarouche committed Sep 8, 2023
1 parent d60d542 commit a295b66
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
# -t ${{ inputs.IMAGE }}:${{ env.GITHUB_SHA_SHORT }}
# -t ${{ inputs.IMAGE }}:latest
# --output=type=image,push=true
# ${GITHUB_WORKSPACE}/${{ inputs.WORKDIR }}
# ${GITHUB_WORKSPACE}/${{ inputs.WORKDIR }}
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/owasp-zap-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@
# echo "URL expires in 10 minutes..."
# gsutil signurl -d 10m gcp-sa-key.json gs://${{ inputs.ZAP_GCP_BUCKET }}/report_html.html
# env:
# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
50 changes: 25 additions & 25 deletions .github/workflows/pre-commit-check.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# name: pre-commit
name: pre-commit

# on:
# push:
# workflow_dispatch:
# jobs:
# pre-commit:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# - uses: terraform-linters/setup-tflint@v1
# with:
# tflint_version: latest
# - uses: pre-commit/action@v3.0.0
# - name: Analyze Kustomize Manifests
# run: |
# pwd
# ls -al
# curl https://get.datree.io | /bin/bash
# datree test tekton/base/pipelines/* --ignore-missing-schemas --no-record
# echo "scanning tasks..."
# datree test tekton/base/tasks/* --ignore-missing-schemas --no-record
# echo "scan triggers..."
# datree test tekton/base/triggers/* --ignore-missing-schemas --no-record
on:
push:
workflow_dispatch:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: terraform-linters/setup-tflint@v1
with:
tflint_version: latest
- uses: pre-commit/action@v3.0.0
- name: Analyze Kustomize Manifests
run: |
pwd
ls -al
curl https://get.datree.io | /bin/bash
datree test tekton/base/pipelines/* --ignore-missing-schemas --no-record
echo "scanning tasks..."
datree test tekton/base/tasks/* --ignore-missing-schemas --no-record
echo "scan triggers..."
datree test tekton/base/triggers/* --ignore-missing-schemas --no-record
2 changes: 1 addition & 1 deletion .github/workflows/sonar-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
# -Dsonar.host.url=${{ inputs.URL }}
# -Dsonar.projectKey=${{ inputs.PROJECT_KEY }}
# -Dsonar.exclusions=**/*.java
# -Dsonar.sourceEncoding=UTF-8
# -Dsonar.sourceEncoding=UTF-8
2 changes: 1 addition & 1 deletion .github/workflows/trivy-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
# exit-code: '0'
# ignore-unfixed: true
# vuln-type: os,library
# severity: CRITICAL
# severity: CRITICAL
26 changes: 13 additions & 13 deletions .github/workflows/trivy-repo.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: trivy-repo-scan
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: "19 23 * * 5"
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: "19 23 * * 5"
# on:
# push:
# branches:
Expand All @@ -24,14 +24,14 @@ jobs:
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-type: "fs"
ignore-unfixed: true
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL'
format: "template"
template: "@/contrib/sarif.tpl"
output: "trivy-results.sarif"
severity: "CRITICAL"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: 'trivy-results.sarif'
sarif_file: "trivy-results.sarif"
41 changes: 40 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,43 @@
# hooks:
# - id: commitlint
# stages: [commit-msg]
# additional_dependencies: ["@commitlint/config-conventional"]
# additional_dependencies: ["@commitlint/config-conventional"]

repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3 # Use the sha or tag you want to point at
hooks:
- id: prettier
# - repo: local
# hooks:
# - id: prettier
# name: Prettier
# language: script
# entry: ./.bin/pre-commit-format.sh
# stages: [commit]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-vcs-permalinks
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [
"-rn", # Only display messages
"-sn", # Don't display the score
]
Loading

0 comments on commit a295b66

Please sign in to comment.