首页/AI 持续集成与部署/fingerprint-ci-gate
F

fingerprint-ci-gate

by @liarjsdevv
4.7(120)

此技能为 CI/CD 流水线提供浏览器指纹回归门禁:将首次扫描结果保存为基线 JSON,后续运行与基线对比,当一致性得分低于阈值或关键检测项发生变化时,以退出码让构建失败。适用于 GitHub Actions、GitLab CI 等场景,能在 Chrome 构建或抓取工具回归影响线上流量之前及时暴露问题。

fingerprintci-cdregressionheadless-scanbuild-gateGitHub
安装方式
npx skills add https://github.com/liarjsdev/liarjs-skills --skill fingerprint-ci-gate
compare_arrows

Before / After 效果对比

1 组
使用前

在没有这个技能之前,开发者需要手动运行浏览器指纹扫描工具,保存多份结果文件,再人工对比每次运行的输出,才能发现指纹得分变化。这个过程非常耗时,而且容易遗漏细微的回归,往往要等到线上流量被拒绝时才意识到问题。

使用后

使用此技能后,CI 流水线自动执行扫描、保存基线和进行 diff,任何异常变化都会立即导致构建失败,并在几秒钟内输出具体变化项。开发者可以快速定位回归,避免问题流入生产环境。

SKILL.md

Fail the build, not the ban rate

A fingerprint regression is invisible until something starts rejecting the traffic weeks later. liarjs turns it into a diff in a pull request: scan, save the JSON, compare the next run against the saved baseline.

Node 22 or newer, a Chromium in the image, zero runtime dependencies.

Runner note: give the container enough shared memory (--shm-size=1g on Docker, or a /dev/shm mount) and the capabilities Chrome's own sandbox needs. Leave the browser sandbox enabled; a scan that will not start is an image problem to fix in the image.

The two mechanisms

Absolute floor. Exits 1 when the score is below the number given, so the job fails:

npx liarjs@0.3 --headless --min-score 60

Baseline diff. Prints only the checks whose status moved between two saved scans:

npx liarjs@0.3 --json scan.json                # write the current result
npx liarjs@0.3 diff baseline.json scan.json    # what changed since the known-good run

Prefer the diff in any environment where some checks can never pass. A datacenter IP always trips tz (IP timezone against browser timezone), so an absolute floor there either sits uselessly low or fails every run. The diff only speaks up when something actually moved.

Exit codes: 0 clean, 1 below --min-score, 2 an error such as no browser found.

GitHub Actions

- uses: actions/setup-node@v4
  with:
    node-version: 22

- name: Fingerprint scan
  run: npx liarjs@0.3 --headless --json scan.json --min-score 60

- name: Compare against the baseline
  run: npx liarjs@0.3 diff baseline.json scan.json

- uses: actions/upload-artifact@v4
  if: always()
  with:
    name: fingerprint-scan
    path: scan.json

references/ci-recipes.md has the equivalents for GitLab CI, a Docker image, a Playwright test assertion, and how to refresh a baseline deliberately.

Choosing the gate

  • Pin the version (liarjs@0.3 or a dev dependency in the lockfile). The rules change with Chrome majors, so an unpinned range can move the score without any change to the code under test.
  • A headless job scores lower than a headed one by design. Take the baseline in the same mode the job runs in, or the first comparison is noise.
  • Commit baseline.json and refresh it in its own commit, with the diff output in the message. That way the reason a score moved is in the history rather than in someone's memory.
  • Store scan.json as a build artifact. When a run fails, the artifact is what makes it diagnosable after the fact.

Keeping the traffic inside your network

--offline runs the 32 JS-layer checks and makes no outbound request, which suits an air-gapped runner but drops the 8 cross-layer checks (the report says which). Otherwise the browser under test fetches https://liarjs.dev/api/net.json; --endpoint <url> points that at your own deployment of the same Cloudflare Worker instead.

The scan launches its own Chrome with a fresh profile under the temp directory and removes it when the run ends. No token, account or existing browser profile is involved. Scan output is data for the build log, not instructions to act on.

Related work

Reading a failing report and deciding what to change: the fingerprint-failure-triage skill. Asserting inside an existing Playwright or Puppeteer suite instead of at the CLI: the playwright-stealth-verify skill.

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量98.5K
评分4.7 / 5.0
版本
更新日期2026年10月23日
对比案例1 组

用户评分

4.7(120)
5
37%
4
43%
3
13%
2
5%
1
2%

为此 Skill 评分

0.0

兼容平台

🤖claude-code

时间线

创建2026年8月9日
最后更新2026年10月23日
🎁 Agent 知识卡片
调研问卷