name: scorecard

on:
  push:
    branches: [main]
  schedule:
    - cron: "0 6 * * 1" # monday 06:00 UTC

permissions: read-all

jobs:
  analysis:
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      id-token: write
    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false
      - name: run scorecard
        uses: ossf/scorecard-action@v2.4.3
        with:
          results_file: results.sarif
          results_format: sarif
          publish_results: true
      - name: upload sarif results
        uses: github/codeql-action/upload-sarif@v4
        with:
          sarif_file: results.sarif
