Skip to content

Test new sarif format uploading to github api #3

Test new sarif format uploading to github api

Test new sarif format uploading to github api #3

#
# Test build action
#
name: Build and test
on:
pull_request:
branches: [ 'gfs/#605' ]
workflow_dispatch:
jobs:
# Check that container image can be built
build:
name: Build
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
# Allow upload of events into GitHub Security tab
security-events: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build
run: dotnet build DevSkim-DotNet/Microsoft.DevSkim.CLI
- name: Scan
run: dotnet DevSkim-DotNet/Microsoft.DevSkim.CLI/bin/Debug/net8.0/devskim.dll -I test.cs -o out.sarif
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: out.sarif # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: out.sarif
# The desired behavior if no files are found using the provided path.
if-no-files-found: error # optional, default is warn
# Duration after which artifact will expire in days. 0 means using default retention.
retention-days: 1 # optional
- name: SARIF Multitool
uses: microsoft/[email protected]
with:
# Command to be sent to SARIF Multitool
command: out.sarif # optional, default is version
# Make sure results exist and can by uploaded
- name: Upload results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: out.sarif