Skip to content

[Snyk] Fix for 4 vulnerabilities #106

[Snyk] Fix for 4 vulnerabilities

[Snyk] Fix for 4 vulnerabilities #106

Workflow file for this run

name: Publish
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'
jobs:
publish:
if: ${{ github.actor != 'dependabot[bot]' }} # ignore dependabot PRs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
- name: Install Dependencies
run: yarn install
- name: Run tests
run: yarn test
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
titenkov/notifir
ghcr.io/notifir/notifir
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/titenkov/notifir:${{ steps.meta.outputs.version }}'
format: 'sarif'
output: 'trivy.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy.sarif'