CI updates (#784)

* ci: remove trivy reporting

* ci: add codeql and remove trivy reporting

* ci: add checkout to read config
This commit is contained in:
silas 2023-11-23 08:00:08 +00:00 committed by GitHub
parent 236aee99d8
commit 3588017fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 55 deletions

View File

@ -144,17 +144,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
# Report all vulnerabilities in security tab
- name: Report on all vulnerabilities
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: 'Cargo.lock'
ignore-unfixed: true
hide-progress: true
format: 'sarif'
output: 'trivy-results.sarif'
# Fail the job on critical vulnerabiliies with fix available
- name: Fail on critical vulnerabilities
uses: aquasecurity/trivy-action@master
@ -167,12 +156,6 @@ jobs:
severity: 'CRITICAL'
exit-code: '1'
- name: Upload output
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'
# Download logs and process them
process-logs:
name: Process logs

View File

@ -59,11 +59,8 @@ jobs:
node-version: '16'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Duplicates check
run: yarn deduplicate
run: npx yarn-deduplicate --list --fail
test:
name: Test
@ -87,23 +84,27 @@ jobs:
sast:
name: Security Scan
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['javascript']
steps:
- name: Checkout code
- name: Checkout repository
uses: actions/checkout@v3
- name: Run semgrep
run: semgrep ci --sarif --output=semgrep-results.sarif
env:
SEMGREP_RULES: p/typescript
- name: Upload output
uses: github/codeql-action/upload-sarif@v2
if: always()
- name: Initialise CodeQL
uses: github/codeql-action/init@v2
with:
sarif_file: semgrep-results.sarif
languages: ${{ matrix.language }}
- name: Run CodeQL
uses: github/codeql-action/analyze@v2
sca:
name: Dependency Scan
@ -112,17 +113,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
# Report all vulnerabilities in security tab
- name: Report on all vulnerabilities
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: 'yarn.lock'
ignore-unfixed: true
hide-progress: true
format: 'sarif'
output: 'trivy-results.sarif'
# Fail the job on critical vulnerabiliies with fix available
- name: Fail on critical vulnerabilities
uses: aquasecurity/trivy-action@master
@ -135,15 +125,9 @@ jobs:
severity: 'CRITICAL'
exit-code: '1'
- name: Upload output
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'
yarn-pass:
name: Yarn tests pass
needs: ['format', 'lint', 'test']
ts-pass:
name: TS tests pass
needs: ['format', 'lint', 'test', 'depcheck']
runs-on: ubuntu-latest
steps:
- run: echo ok
@ -157,7 +141,7 @@ jobs:
all-pass:
name: All tests pass 🚀
needs: ['yarn-pass', 'security-pass']
needs: ['ts-pass', 'security-pass']
runs-on: ubuntu-latest
steps:
- run: echo ok

View File

@ -12,6 +12,10 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- name: Checkout repo
uses: actions/checkout@v3
- name: Run label config
uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'