Update Snyk.yml #49
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: Node.js CI/CD with NPM | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.APPID }} | |
private-key: ${{ secrets.PRIVATEKEY }} | |
- name: Use the token | |
env: | |
GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
run: | | |
gh api octocat | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' # You can adjust the version as needed | |
- name: Install dependencies | |
run: npm install | |
- name: Install mocha | |
run: npm install -g mochawesome mochawesome-report-generator | |
- name: unit test | |
run: npm run test:unit | |
- name: BDD test | |
run: npm run test:bdd | |
- name: Run Snyk to check for vulnerabilities | |
uses: snyk/actions/maven@master | |
continue-on-error: true | |
env: | |
SNYK_TOKEN: ${{secrets.SNYK_TOKEN}} | |