name: 'openssf'
on:
  push:
    branches:
      - master
jobs:
  scorecard:
    name: OpenSSF
    runs-on: ubuntu-latest
    permissions:
      # Needed to upload the results to code-scanning dashboard.
      security-events: write
      actions: read
      contents: read
      # Needed to access OIDC token.
      id-token: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          persist-credentials: false
      - name: OSSF Scorecard action
        uses: ossf/scorecard-action@v2.1.3
        with:
          results_file: results.sarif
          results_format: sarif
          publish_results: true
      - name: "Upload SARIF results to code scanning"
        uses: github/codeql-action/upload-sarif@v2.3.6
        with:
          sarif_file: results.sarif
