Pin dependencies #3199
Workflow file for this run
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
--- | |
name: main | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
DATREE_TOKEN: ${{ secrets.DATREE_TOKEN }} | |
jobs: | |
env: | |
uses: devxp-tech/.github/.github/workflows/env.yaml@main | |
yaml-linter: | |
name: Yaml Linter π§Ή | |
runs-on: ubuntu-latest | |
needs: | |
- env | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
- name: Yaml Lint | |
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3 | |
with: | |
no_warnings: true | |
kube-linter: | |
name: Kube Linter π§Ή | |
runs-on: ubuntu-latest | |
needs: | |
- env | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
- name: Scan repo | |
id: kube-lint-repo | |
uses: stackrox/kube-linter-action@ca0d55b925470deb5b04b556e6c4276ea94d03c3 # v1.0.4 | |
with: | |
directory: apps | |
format: sarif | |
output-file: kube-linter.sarif | |
continue-on-error: true | |
secret-find: | |
name: Secrets Find π | |
runs-on: ubuntu-latest | |
needs: | |
- env | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
- name: Find Secrets π | |
shell: bash | |
run: | | |
if find apps/ -name '*.yaml' | xargs grep -q "kind: Secret"; then | |
echo "Fail, secret found! :(" | |
exit 1 | |
else | |
echo "Success, secret not found! :)" | |
exit 0 | |
fi | |
# datree-check: | |
# name: Datree Check π | |
# runs-on: ubuntu-latest | |
# needs: | |
# - env | |
# steps: | |
# - name: Checkout ποΈ | |
# uses: actions/checkout@v3 | |
# - name: Run Datree Policy Check | |
# uses: datreeio/action-datree@main | |
# with: | |
# path: 'apps/*/base/*.yaml' | |
# cliArguments: '--only-k8s-files --ignore-missing-schemas' | |
trivy-scan: | |
name: Trivy Vulnerability Scanner π | |
needs: | |
- env | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code ποΈ | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
- name: Run Trivy vulnerability scanner in IaC mode π | |
uses: aquasecurity/trivy-action@master | |
with: | |
scan-type: 'config' | |
hide-progress: false | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
exit-code: '1' | |
ignore-unfixed: true | |
severity: 'CRITICAL,HIGH' | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@4759df8df70c5ebe7042c3029bbace20eee13edd # v2 | |
if: always() | |
with: | |
sarif_file: 'trivy-results.sarif' | |
quality-gate: | |
uses: devxp-tech/.github/.github/workflows/sonarqube.yaml@main | |
secrets: inherit | |
needs: | |
- env | |
- yaml-linter | |
- kube-linter | |
- secret-find | |
# - datree-check | |
- trivy-scan | |
notify: | |
uses: devxp-tech/.github/.github/workflows/notify.yaml@main | |
if: always() | |
secrets: inherit | |
needs: | |
- env | |
- yaml-linter | |
- kube-linter | |
- secret-find | |
# - datree-check | |
- quality-gate | |
- trivy-scan |