name: Security validation

on:
  pull_request:
    branches:
      - 'develop'
      - 'main'

jobs:
  security:
    name: Check for vulnerabilities
    runs-on: ubuntu-latest
    env:
      SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
    steps:
      - uses: actions/checkout@v2

      - uses: snyk/actions/setup@master
      - name: Set up Go 1.16
        uses: actions/setup-go@v2
        with:
          go-version: '1.16'

      - name: Run snyl on all projects
        run: snyk test --all-projects
