Skip to content

Add SonarCloud SAST scan to GitHub Actions workflow #10

Add SonarCloud SAST scan to GitHub Actions workflow

Add SonarCloud SAST scan to GitHub Actions workflow #10

Workflow file for this run

name: CI/CD Pipeline on Github Actions
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
- name: SAST Scan on Source Code using SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=github-sast-tests
-Dsonar.projectKey=github-sast-tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
security:
runs-on: ubuntu-latest
needs: build
name: Run the SCA scan on the source code
steps:
- uses: actions/checkout@v2
- name: Run the SCA scan on the source code
uses: snyk/actions/node@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}