Skip to content
Latchkey

OpenSSF Scorecard workflow (spf13/cast)

The OpenSSF Scorecard workflow from spf13/cast, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: spf13/cast.github/workflows/analysis-scorecard.yamlLicense MITView source

What it does

This is the OpenSSF Scorecard workflow from the spf13/cast repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: OpenSSF Scorecard

on:
  branch_protection_rule:
  push:
    branches: [master]
  schedule:
    - cron: "30 0 * * 5"

permissions:
  contents: read

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest

    permissions:
      actions: read
      contents: read
      id-token: write
      security-events: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          persist-credentials: false

      - name: Run analysis
        uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
        with:
          results_file: results.sarif
          results_format: sarif
          publish_results: true

      - name: Upload results as artifact
        uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
        with:
          name: OpenSSF Scorecard results
          path: results.sarif
          retention-days: 5

      - name: Upload results to GitHub Security tab
        uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
        with:
          sarif_file: results.sarif

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: OpenSSF Scorecard
 
on:
  branch_protection_rule:
  push:
    branches: [master]
  schedule:
    - cron: "30 0 * * 5"
 
permissions:
  contents: read
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  analyze:
    timeout-minutes: 30
    name: Analyze
    runs-on: latchkey-small
 
    permissions:
      actions: read
      contents: read
      id-token: write
      security-events: write
 
    steps:
      - name: Checkout repository
        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          persist-credentials: false
 
      - name: Run analysis
        uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
        with:
          results_file: results.sarif
          results_format: sarif
          publish_results: true
 
      - name: Upload results as artifact
        uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
        with:
          name: OpenSSF Scorecard results
          path: results.sarif
          retention-days: 5
 
      - name: Upload results to GitHub Security tab
        uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v3.29.5
        with:
          sarif_file: results.sarif
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow