No description
  • TypeScript 99.8%
  • JavaScript 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-14 08:39:02 +01:00
.forgejo/workflows feat: deps-watch action with OSV, essential freshness and RKD/Discord/Slack/generic sinks 2026-10-21 15:46:04 +08:00
dist fix: link the run on its public host and web run number 2026-11-14 11:34:35 +04:00
docs feat: deps-watch action with OSV, essential freshness and RKD/Discord/Slack/generic sinks 2026-10-21 15:46:04 +08:00
scripts feat: deps-watch action with OSV, essential freshness and RKD/Discord/Slack/generic sinks 2026-10-21 15:46:04 +08:00
src fix: link the run on its public host and web run number 2026-11-14 11:34:35 +04:00
.gitignore feat: deps-watch action with OSV, essential freshness and RKD/Discord/Slack/generic sinks 2026-10-21 15:46:04 +08:00
action.yml fix: link the run on its public host and web run number 2026-11-14 11:34:35 +04:00
package.json fix: link the run on its public host and web run number 2026-11-14 11:34:35 +04:00
pnpm-lock.yaml feat: deps-watch action with OSV, essential freshness and RKD/Discord/Slack/generic sinks 2026-10-21 15:46:04 +08:00
README.md fix: link the run on its public host and web run number 2026-11-14 11:34:35 +04:00
tsconfig.json feat: deps-watch action with OSV, essential freshness and RKD/Discord/Slack/generic sinks 2026-10-21 15:46:04 +08:00
vitest.config.mts feat: deps-watch action with OSV, essential freshness and RKD/Discord/Slack/generic sinks 2026-10-21 15:46:04 +08:00

deps-watch

A daily dependency report for Forgejo Actions and GitHub Actions. It scans every lockfile in a repository for known vulnerabilities, checks whether the packages you have marked essential have a newer release, and posts what is new since the last run to an RKD channel, Discord, Slack, or any URL.

  • Vulnerabilities come from OSV-Scanner (pinned, checksum-verified), which covers Cargo, pnpm, npm, Gradle, SPM, pip and more.
  • Essential freshness compares the locked version with the newest published release on npm and crates.io, so a major bump outside your caret range shows up.
  • Everything else is a single count. Browse those in Renovate.

Nothing is posted when nothing changed, except a short "all quiet" heartbeat once a week. A new vulnerability fails the job. A new major bump of an essential, or a new vulnerability, carries the mention prefix you configure (for RKD that is <@everyone>).

Quick start

.forgejo/workflows/deps-watch.yml (or .github/workflows/):

name: deps-watch
on:
  schedule:
    - cron: "17 6 * * *"
  workflow_dispatch:
jobs:
  report:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: actions/cache/restore@v4
        with:
          path: .deps-watch
          key: deps-watch-${{ github.run_id }}
          restore-keys: deps-watch-
      - uses: nanoya-biz/deps-watch@v1
        with:
          sinks: rkd,summary
          mention: "<@everyone>"
          rkd-base-url: ${{ secrets.RKD_BASE_URL }}
          rkd-channel-id: ${{ secrets.RKD_CHANNEL_ID }}
          rkd-token: ${{ secrets.RKD_APP_TOKEN }}
      - uses: actions/cache/save@v4
        if: always()
        with:
          path: .deps-watch
          key: deps-watch-${{ github.run_id }}
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: deps-watch-report
          path: |
            .deps-watch/report.md
            .deps-watch/report.json

The full report is written as report.md and report.json next to the state file on every run, and also to the job summary. Forgejo renders job summaries only from version 17 with runner 13.2 or newer, so the artifact upload is what makes the full table reachable on older instances; on GitHub the summary tab shows it directly and the upload step is optional.

The cache steps are what make "new since last run" work: the action writes its state to .deps-watch/state.json and reads it back on the next run. Use the split restore and save steps, with if: always() on the save, rather than the combined actions/cache: the combined action only saves on a green job, and a run that found a new vulnerability is red by design, so its state would never be saved and the same advisories would be new again every day.

state-file resolves against working-directory, so when you scan a subdirectory, point the cache path at the same place.

.deps-watch.toml at the repository root:

[essential]
npm    = ["electron", "svelte", "vite", "@tauri-apps/api"]
crates = ["tauri", "axum", "sqlx", "tokio"]

[[ignore]]
id     = "RUSTSEC-2024-0436"
until  = "2026-12-31"
reason = "paste is pulled in by a build dependency, no runtime exposure"

An ignore matches the advisory id or any of its aliases (GHSA, CVE, RUSTSEC). Once until has passed the advisory is reported again and the entry shows as expired in the summary, so nothing is silenced forever.

Inputs

Input Default Purpose
config .deps-watch.toml Config path, relative to working-directory
working-directory . Repository root to scan
sinks summary Comma-separated: summary, rkd, discord, slack, generic
mention Prefix for posts carrying a new vulnerability or a new major essential bump
rkd-base-url RKD server, e.g. https://chat.example.com
rkd-channel-id Channel to post into
rkd-token RKD App token (rkda_…) with messages:write
discord-webhook-url Discord incoming webhook
slack-webhook-url Slack incoming webhook
generic-url Any URL; receives { text, report } as JSON by POST
generic-secret If set, adds X-Deps-Watch-Signature: sha256=<hmac> over the body
state-file .deps-watch/state.json Where last run's keys live; cache this path. report.md and report.json land next to it
heartbeat-day monday UTC weekday for the all-quiet post, or none
fail-on-new-vulnerability true Fail the job on a vulnerability not seen last run
server-url GITHUB_SERVER_URL Public base URL for the run link. Set it on Forgejo when the runner registered against an internal host (e.g. http://forgejo:3000)

Outputs: new-vulnerabilities, new-essential-updates, posted.

What a post looks like

<@everyone> deps-watch: 2 new vulnerabilities, 1 new essential update
**Vulnerabilities (12)**
• 🆕 **tauri** 2.10.3 → 2.11.1 · high · GHSA-7gmj-67g7-phm9
• 🆕 **@xmldom/xmldom** 0.8.11 → 0.8.15 · high · 13 advisories
• **rustls** 0.23.38 → 0.23.45 · medium · GHSA-2mjx-qc3c-rqvc
… 7 more in the job summary
**Essential updates (5)**
• 🆕 **svelte** 5.38.0 → 6.0.0 · major · 3 lockfiles
• 🆕 **sqlx** 0.8.6 → 0.9.0 · major
• **tauri** 2.10.3 → 2.11.1 · patch
Informational (3): fxhash, paste, proc-macro-error
41 other updates pending · https://git.example.com/org/repo/actions/runs/42

Chat posts show one line per affected package version and one line per essential, and cap each section at 15 lines. A minor bump below 1.0 counts as major, the way Cargo treats it. A major bump is new once per major: Svelte 6.0.0 posts with the mention, 6.0.1 the next day does not. Minor and patch releases of your current line are new each time, since they are the ones you can merge.

A vulnerability is tracked under all of its ids, so an advisory that gains a GHSA or CVE alias later is not reported new again. If a chat sink is down, the new entries stay pending and are posted on the next run. If a registry lookup fails, that package's previous state is kept rather than forgotten. The job summary has every advisory and every lockfile in full, plus the informational advisories (RustSec "unmaintained" and "unsound" notices, which never fail the job or trigger the mention) and the ignore list with its expiry status.

Lockfiles are discovered through git ls-files, so ignored directories such as build output or local worktrees are never scanned; outside a git checkout the action walks the tree and skips node_modules, target and dist.

Sinks

RKD

Posting into an RKD channel uses an App, the same identity model as any other RKD integration:

  1. Create the App through the server's internal API with the messages:write scope. The response contains the rkda_… token once; store it as a secret.
  2. Install the App on the server that owns the target channel (server settings → Apps). An installed App can post into any channel of that server.
  3. Set rkd-base-url, rkd-channel-id and rkd-token.

The mention prefix is sent verbatim, so use RKD's wire form: <@everyone>, <@here>, <@user-id> or <@&role-id>. The same prefix goes to every chat sink, so when you combine RKD with Discord or Slack pick one that both accept, or leave it empty.

Discord and Slack

Create an incoming webhook in the channel settings and pass its URL. Discord posts are split at 2000 characters on a line boundary. Slack receives the same text with **bold** converted to *bold*.

Generic

Any HTTPS endpoint. The body is {"text": "<chat text>", "report": {...}}; the report object has vulnerabilities, informational, essential_updates, other_updates and ignored, each entry carrying is_new. With generic-secret set, verify the request like this:

const expected = "sha256=" + createHmac("sha256", secret).update(rawBody).digest("hex");
const given = req.headers["x-deps-watch-signature"] ?? "";
const ok = given.length === expected.length && timingSafeEqual(Buffer.from(expected), Buffer.from(given));

Pairing with Renovate

deps-watch tells you what is new and urgent. Renovate's dependency dashboard is the place to browse the long tail. A low-noise Renovate setup that pairs well:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "dependencyDashboard": true,
  "dependencyDashboardApproval": true,
  "osvVulnerabilityAlerts": false,
  "lockFileMaintenance": { "enabled": false }
}

With dependencyDashboardApproval, Renovate opens a PR only for the entries you tick in the dashboard issue. OSV alerts stay off because deps-watch owns that signal.

Development

pnpm install
pnpm verify        # typecheck + tests + build

dist/index.js is committed because actions run it directly. CI fails when the bundle is stale, so run pnpm build before committing a change under src/.

To run locally against another checkout:

env INPUT_CONFIG=/path/to/.deps-watch.toml \
    "INPUT_WORKING-DIRECTORY=/path/to/repo" \
    INPUT_SINKS=summary \
    GITHUB_STEP_SUMMARY=/tmp/summary.md \
    node dist/index.js

Input names keep their hyphens in the environment, exactly as the Actions runner sets them.

Releasing

Tag releases as vX.Y.Z and move the v1 tag to the newest compatible release:

git tag v1.0.0
git tag -f v1
git push origin v1.0.0 && git push -f origin v1

Consumers pin @v1 and pick up fixes without editing their workflow.