Skip to content

Commit

Permalink
ci: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
silas-x committed Nov 19, 2023
1 parent 73537eb commit 3ee4109
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 101 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Code Review

on:
pull_request:
branches: ['main']
push:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'

- name: Install dependencies
run: yarn ci

- name: Lint
run: yarn lint

sast:
name: Security Scan
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript']

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialise CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Run CodeQL
uses: github/codeql-action/analyze@v2

sca:
name: Dependency Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

# Fail the job on critical vulnerabiliies with fix available
- name: Fail on critical vulnerabilities
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
hide-progress: true
format: 'table'
severity: 'CRITICAL'
exit-code: '1'

all-pass:
name: All tests pass 🚀
needs: ['lint', 'sast', 'sca']
runs-on: ubuntu-latest
steps:
- run: echo ok
50 changes: 0 additions & 50 deletions .github/workflows/codeql-scan.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/trivy-scan.yml

This file was deleted.

0 comments on commit 3ee4109

Please sign in to comment.