# GitHub Dependency Risk Triage with OSV (`thirdwatch/github-dependency-risk-triage`) Actor

Read dependency manifests through a GitHub MCP connector, check pinned versions against OSV, and create or update a source-linked review issue without changing code.

- **URL**: https://apify.com/thirdwatch/github-dependency-risk-triage.md
- **Developed by:** [Thirdwatch](https://apify.com/thirdwatch) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## GitHub Dependency Risk Triage with OSV

Read pinned dependency versions from a GitHub repository through an Apify MCP connector, check them with the [OSV Vulnerability Scraper](https://apify.com/thirdwatch/osv-vulnerability-scraper), and create or update a source-linked GitHub issue for human review.

### Why the connector matters

The Actor can read a private repository and write its review artifact without receiving or logging a GitHub token. The caller supplies one authorized connector; Apify keeps the credential server-side and exposes only three tools declared by the input schema:

- `get_file_contents`
- `search_issues`
- `issue_write`

The Actor cannot edit files, create branches, open pull requests, merge code, or call any other GitHub tool.

### Supported manifests

- Exact versions in `dependencies`, `devDependencies`, and `optionalDependencies` in `package.json`.
- Pinned `name==version` entries in requirements files.

Ranges such as `^1.2.3`, `~=2.0`, and unpinned dependencies are skipped because OSV needs an installed version for a defensible version query. Missing manifests and parse failures are returned explicitly.

The Actor accepts at most five manifest paths, rejects files above 1 MB, caps exact packages, validates npm/PyPI names and versions, and writes at most one issue per run. Advisory strings are escaped for a Markdown table and only HTTPS source URLs become links.

### Safe operating model

Dry run is the default. To post an issue, disable dry run and enter the exact `owner/repo` in `confirmWriteTarget`; use only a repository you own or are explicitly authorized to modify.

The issue is a triage queue. A published advisory does not prove the vulnerable code path is deployed; a missing advisory does not prove a package is safe. The Actor deliberately does not modify a dependency or open a pull request. On sequential runs it updates only an issue whose body contains the Actor's invisible marker; a human-authored title collision is never overwritten. Overlapping schedules for the same repository are unsupported.

# Actor input Schema

## `githubConnector` (type: `string`):

Authorized GitHub connector limited to reading files, searching issues, and creating or updating an issue.

## `owner` (type: `string`):

GitHub user or organization that owns the repository.

## `repo` (type: `string`):

Repository name without the owner or URL.

## `ref` (type: `string`):

Optional branch, tag, or full ref. Leave empty for the default branch.

## `manifestPaths` (type: `array`):

Supports package.json and pinned requirements.txt entries. Missing paths are reported and skipped.

## `maxPackages` (type: `integer`):

Stop after this many distinct pinned versions across the selected manifests.

## `updateExistingIssue` (type: `boolean`):

Search for the stable issue title and update it instead of opening duplicates.

## `issueLabels` (type: `array`):

Labels must already exist in the repository. Leave empty when unsure.

## `dryRun` (type: `boolean`):

Read manifests and run OSV without writing a GitHub issue.

## `confirmWriteTarget` (type: `string`):

Required when Dry run is off. Enter the exact owner/repo and write only to a repository you own or are explicitly authorized to modify.

## Actor input object example

```json
{
  "ref": "",
  "manifestPaths": [
    "package.json",
    "requirements.txt"
  ],
  "maxPackages": 100,
  "updateExistingIssue": true,
  "issueLabels": [],
  "dryRun": true,
  "confirmWriteTarget": ""
}
```

# Actor output Schema

## `results` (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 = {
    "manifestPaths": [
        "package.json",
        "requirements.txt"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thirdwatch/github-dependency-risk-triage").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 = { "manifestPaths": [
        "package.json",
        "requirements.txt",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thirdwatch/github-dependency-risk-triage").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 '{
  "manifestPaths": [
    "package.json",
    "requirements.txt"
  ]
}' |
apify call thirdwatch/github-dependency-risk-triage --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thirdwatch/github-dependency-risk-triage"
        }
    }
}

```

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/mQW52M03Q22MGjR6h/builds/4xJSAAKzOZFjhiOqh/openapi.json
