Skip to content

Harden the github workflows and action (#1665) #2533

Harden the github workflows and action (#1665)

Harden the github workflows and action (#1665) #2533

Workflow file for this run

name: "Security Scan"
# Run workflow each time code is pushed to your repository and on a schedule.
# The scheduled workflow runs every at 00:00 on Sunday UTC time.
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Security Scan
uses: securego/gosec@4a3bd8af174872c778439083ded7adbf3747e770 # v2.26.1
with:
# we let the report trigger content trigger a failure using the GitHub Security features.
args: '-no-fail -fmt sarif -out results.sarif -exclude-dir=testdata ./...'
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@e46ed2cbd01164d986452f91f178727624ae40d7 # v4
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif