npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ghostsecret

v0.1.0

Published

Find the GitHub Actions secrets that silently disappear

Readme

ghostsecret

Find the GitHub Actions secrets that silently disappear.

npm version license node

The Problem

GitHub Actions secrets silently resolve to empty strings in certain contexts — fork PRs, Dependabot runs, misspelled names, wrong scope. When this happens, workflows fail with misleading errors like "authentication failed" instead of "secret was empty." Developers waste hours debugging the wrong problem. This tool catches these issues statically, before they hit CI.

Quick Start

# Scan current repo
npx ghostsecret

# Scan a specific repo
npx ghostsecret --path /path/to/repo

# With GitHub token for typo detection
GITHUB_TOKEN=ghp_xxx npx ghostsecret

# JSON output for CI
npx ghostsecret --format json

What It Catches

| Rule | Severity | What it catches | |------|----------|-----------------| | secrets-in-fork-pr | ⚡ warning | Secrets used in pull_request triggered workflows — empty on fork PRs | | pr-target-checkout | ✖ error | Dangerous pull_request_target + PR head checkout + secrets pattern (exfiltration risk) | | no-empty-check | ● info | Secrets used without if: ${{ secrets.X != '' }} guards | | undefined-secret | ✖ error | Secret referenced in workflow but not defined in repo (typo detection with fuzzy matching) | | unused-secret | ● info | Secret defined in repo but never referenced in any workflow (drift detection) |

Example Output

  ghostsecret v0.1.0

  sample-ci.yml

    ⚡ secrets-in-fork-pr
      Secrets will be empty on fork PRs (trigger: pull_request)
      secrets: GLOBAL_TOKEN  API_KEY  DATABASE_URL  DEPLOY_TOKEN (×2)  LINT_KEY
      lines:   10  22  23  26  29  35
      ↳ Split into two workflows: fork PRs (no secrets) + pull_request_target for trusted ops

    ● no-empty-check
      Secrets used without empty-string guards
      secrets: GLOBAL_TOKEN  API_KEY  DATABASE_URL  LINT_KEY
      lines:   10  22  23  35
      ↳ Add: if: ${{ secrets.GLOBAL_TOKEN != '' }}

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  │ 10 issues   0 errors   6 warnings   4 info
  │
  │ Run with --format json for CI-friendly output

CLI Options

| Option | Description | Default | |--------|-------------|---------| | --path <dir> | Path to repository root | . | | --format <type> | Output format: terminal or json | terminal | | --token <token> | GitHub token (or set GITHUB_TOKEN env var) | — | | --ignore <rules> | Comma-separated rule IDs to skip | — | | --strict | Treat warnings as errors (exit code 1) | false |

Use in CI

# .github/workflows/lint-secrets.yml
name: Lint Secrets
on: [push, pull_request]
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Check secrets usage
        run: npx ghostsecret --strict
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GITHUB_TOKEN is automatically available in GitHub Actions — no extra setup needed. This enables the undefined-secret and unused-secret rules.

Why Not Just Use X?

  • GitHub secret scanning detects leaked secrets in code. Different problem — we detect secrets that will be empty at runtime.
  • actionlint is a general workflow linter. It doesn't analyze secret availability by trigger context or check against your repo's actual defined secrets.
  • gitleaks / truffleHog prevent secret leaks. Complementary tools, not substitutes.

Contributing

  1. Fork the repo and create a feature branch
  2. Run npm test before submitting a PR
  3. Each new rule should be its own file in src/rules/ implementing the LintRule interface

License

MIT