Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add static-analysis checks to CI/CD #1219

Merged
merged 25 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Grype Vulnerability Scan
name: Container Scans

permissions:
contents: read
actions: read
contents: write # for sbom-action artifact uploads

on:
push:
Expand All @@ -12,7 +13,7 @@ on:
- main

jobs:
grype-scan:
container-scans:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand All @@ -23,11 +24,17 @@ jobs:
cache: "npm"
- name: Install Pepr Dependencies
run: npm ci
- name: Build Pepr Dev Image
- name: Build Pepr Controller Image
run: npm run build:image
- name: Scan image
- name: Vulnerability Scan
uses: anchore/scan-action@64a33b277ea7a1215a3c142735a1091341939ff5 # v4.1.2
with:
image: "pepr:dev"
fail-build: true
severity-cutoff: high
- name: Generate SBOM
uses: anchore/sbom-action@v0
with:
image: pepr:dev
upload-artifact: true
upload-artifact-retention: 30
23 changes: 23 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,26 @@ jobs:
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: 'Dependency Review'
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4

circular-dependencies:
runs-on: ubuntu-latest
steps:
- name: setup node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
cache-dependency-path: pepr
- name: 'Checkout Repository'
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Circular Dependency Check
run: |
npx madge --circular --ts-config tsconfig.json --extensions ts,js src/ > tmp.log || true # Force exit 0 for post-processing
tail -n +4 tmp.log > circular-deps.log
if [ $(wc -l < circular-deps.log) -gt 18 ]; then
echo "circular-deps.log has more than 18 circular dependencies."
wc -l circular-deps.log
exit 1
else
echo "circular-deps.log has 18 or fewer circular dependencies."
exit 0
fi
15 changes: 15 additions & 0 deletions .github/workflows/secret-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: secret-scan
on: pull_request

jobs:
secret-scan: # scan for any live secrets in the repository using trufflehog
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Default Secret Scanning
uses: trufflesecurity/trufflehog@main
with:
extra_args: --debug --no-verification # Warn on potential violations
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

# Binaries for programs and plugins
*.log
*.exe
*.exe~
*.dll
Expand Down
Loading