# OpenSSF Scorecard Regression Monitor (`natstandridge/openssf-scorecard-regression-monitor`) Actor

Check a bounded public GitHub repository watchlist against OpenSSF Scorecard, then compare a prior Actor dataset to flag only fresh, same-version threshold crossings. Returns source dates and inconclusive states; no security verdict.

- **URL**: https://apify.com/natstandridge/openssf-scorecard-regression-monitor.md
- **Developed by:** [Nathaniel Standridge](https://apify.com/natstandridge) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$6.00 / 1,000 delivered openssf repository checks

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OpenSSF Scorecard Regression Monitor

Review check-level changes for a watchlist of **public GitHub repositories**. The Actor reads OpenSSF's published Scorecard results, emits one validated repository row per available scan, and highlights downward crossings of your chosen score threshold only when the previous and current scans are comparable.

An open-source program office can run this weekly, paste the previous run's dataset JSON into the next input, and send `regressions` to a maintainer review queue. The current-results exporters in the Apify Store are alternatives for raw snapshots; this Actor adds date and method gates, an explicit inconclusive state, and a compact threshold-crossing queue. The value of that convenience has not yet been validated by paying customers.

### First run

1. Leave the default `github.com/ossf/scorecard` repository in place or enter your own `owner/repo` list. You can supply up to 100 entries. At the proposed price, the default single-repository run would cost **$0.006** if OpenSSF has a valid result and the run's charge limit allows delivery.
2. Optionally set `checks` to exact names such as `Branch-Protection` and `Vulnerabilities`. An empty list includes every check in the current result. Set `alertBelow` to the score threshold your team wants to review.
3. Run once. The default dataset has one `repository_check` row for each validated scan. Save the dataset JSON. `OUTPUT` lists unscanned or unavailable repositories without charging for them.
4. On a later run, paste that dataset array into `previousResultsJson` and reuse `monitorKey`. A check enters `regressions` only when its previous score was at least `alertBelow`, its new score is below it, and the source scans pass every comparability gate.

For a scheduled workflow, an external Apify integration or task orchestration step must pass the previous run's dataset as the next input. This Actor does not silently retain a buyer-wide watchlist or previous results. A baseline run without `previousResultsJson` produces no regression alert.

### Comparison rules

- Results must come from the same canonical `github.com/owner/repo`, with the same Scorecard version **and Scorecard source commit**. A changed method version or source commit produces `scorecard_version_changed` and no alert.
- The new scan date must be later than the previous date, within `maxComparisonGapDays` (45 by default). A current scan older than `maxScanAgeDays` (21 by default) is reported as stale and cannot alert.
- OpenSSF sometimes publishes a calendar date and sometimes a timestamp. `sourceDatePrecision` records which was used. A precision change suppresses comparison. Day-only dates are normalized to midnight UTC for output; the comparison uses calendar dates.
- Score `-1` means inconclusive. A missing or inconclusive selected check produces no alert. A lower score that does **not** cross the configured threshold is shown as `decreased_no_crossing`, not as an alert.
- These are heuristic project signals. A low score, a score change, or a missing scan is **not** a security verdict or a vulnerability report. Review the official result and the underlying repository before taking action.

### Input and output

[`examples/input.json`](examples/input.json) is a one-repository baseline. [`examples/previous-results.json`](examples/previous-results.json) and [`examples/output.json`](examples/output.json) are **synthetic** and show a prior score of 7 crossing below 5. They are not claims about the named project's real state.

Each dataset row includes the official result date, date precision, Scorecard version and commit, scored repository commit, selected check scores, comparison status, and a `regressions` array. `OUTPUT` includes requested/verified/delivered counts, source diagnostics and the delivered regression count. A successful process with `OUTPUT.status=partial` has missing source coverage; inspect `diagnostics` before using it.

### Price, limits and privacy

Proposed price: **$0.006 per validated repository row delivered to the default dataset**, including a valid unchanged or inconclusive scan. There is no separate start, check, or alert charge. Missing scans, API failures, and invalid source responses produce no dataset row and no event. If the run's charge limit cannot cover all validated rows, the Actor writes none and reports `charge_limit`. The source API is public and needs no token, proxy, or paid data provider; cloud execution cost still needs measurement before release.

The Actor contacts only `https://api.scorecard.dev/projects/github.com/{owner}/{repo}`. It rejects URL inputs, private-network destinations, redirects, duplicate repository paths, oversized responses, and malformed prior data. It sends no credentials to the source. Source calls have bounded timeouts and read-only retries. A run can be partial if the source is missing or unavailable, and OpenSSF scan schedules and coverage are outside this Actor's control.

Billable writes use a frozen result plan and a pending-delivery checkpoint. An uncertain append stops for readback instead of replaying a potentially charged write. Resuming the same run verifies existing dataset rows against the plan and native event count before continuing. Output schema, source and tests are included in this project. No live Apify qualification, customer demand, revenue, or profit is claimed by local tests.

Sources: [OpenSSF Scorecard infrastructure and results API](https://github.com/ossf/scorecard-infra), [OpenSSF Scorecard project](https://github.com/ossf/scorecard), [Apify Python pay-per-event guidance](https://docs.apify.com/sdk/python/docs/concepts/pay-per-event).

# Actor input Schema

## `repositories` (type: `array`):

One owner/repo or github.com/owner/repo per entry. At most 100; duplicates and URLs are rejected. Only api.scorecard.dev is contacted.

## `checks` (type: `array`):

Leave empty to include every check in the current Scorecard result. Example: Branch-Protection, Vulnerabilities.

## `alertBelow` (type: `integer`):

Alert only when a comparable prior check score was at least this value and the new score is below it. Scores are heuristic signals, not security verdicts.

## `monitorKey` (type: `string`):

Stable label included in output. Reuse it when pasting results from a previous run.

## `previousResultsJson` (type: `string`):

Paste the JSON array from this Actor's earlier default dataset. It is user-supplied comparison evidence; there is no account-wide state or automatic history. Leave empty for a baseline. Maximum 2 MiB and 100 rows.

## `maxScanAgeDays` (type: `integer`):

Older official scans still produce a status row, but cannot trigger a regression alert.

## `maxComparisonGapDays` (type: `integer`):

A larger gap suppresses threshold alerts and marks the scans incomparable.

## `maxRunSeconds` (type: `integer`):

Includes bounded source requests and delivery. Unfetched repositories are reported as uncharged diagnostics.

## Actor input object example

```json
{
  "repositories": [
    "github.com/ossf/scorecard"
  ],
  "checks": [],
  "alertBelow": 5,
  "monitorKey": "default",
  "maxScanAgeDays": 21,
  "maxComparisonGapDays": 45,
  "maxRunSeconds": 180
}
```

# Actor output Schema

## `repositoryChecks` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("natstandridge/openssf-scorecard-regression-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("natstandridge/openssf-scorecard-regression-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call natstandridge/openssf-scorecard-regression-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,natstandridge/openssf-scorecard-regression-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/N3sRfzylRr1EYXfo2/builds/MfK855zFEqRRaOOMa/openapi.json
