Skip to content

another way how to generate sarif artifact #30

another way how to generate sarif artifact

another way how to generate sarif artifact #30

Workflow file for this run

name: Build and Push r0oth3x49/ghauri to burso/ghauri
on:
push:
branches:
- main # Change to your default branch if not main
pull_request:
branches:
- main # Change to your default branch if not main
jobs:
build-and-push:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
- name: Set release version
id: set_version
run: echo "RELEASE_VERSION=1.4.1" >> $GITHUB_ENV
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push Docker image
run: |
docker buildx build --push \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/ghauri:${{ env.RELEASE_VERSION }} \
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/ghauri:latest \
--platform linux/amd64,linux/arm64 ./files/ghauri
- name: Logout from Docker Hub
run: docker logout
- name: Check burso/ghauri image
uses: snyk/actions/docker@master
with:
image: burso/ghauri
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk.sarif