Skip to content

ci: add weekly cron to refresh headers-order.json - #30

Merged
Kikobeats merged 3 commits into
masterfrom
Kikobeats/headers-order-cron
Oct 28, 2026
Merged

Kikobeats merged 3 commits into
masterfrom
Kikobeats/headers-order-cron

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What

Adds .github/workflows/cron.yml, a weekly job (Monday 00:00 UTC, plus manual workflow_dispatch) that refreshes src/headers-order.json, using the same pattern as country-vat / free-email-domains:

  1. npm run postinstall fetches the upstream file from apify/fingerprint-suite
  2. npm test runs, so if upstream changes its format the job fails before anything reaches master
  3. commits build(update): headers order only when the file actually changed
  4. git push origin HEAD using GH_TOKEN, so the push triggers main.yml and that publishes a release

Note on "outdated"

Today the local file matches upstream byte for byte (checked against raw.githubusercontent.com, not only the githack cache). Upstream pushed a model update on 2026-08-01 and reverted it on 2026-08-05 (apify/fingerprint-suite#565), so the current source data is the June 2025 data again. This cron picks up the next upstream update automatically.

Tested

  • Simulated the cron steps in a throwaway clone. With an unchanged file: no commit. With a stale file: a single build(update): headers order commit that restores upstream.
  • actionlint passes. I replaced github.head_ref, which is empty on schedule and which actionlint flags as an injection risk, with HEAD.
  • npm test: 20 passed.

Postinstall

The postinstall now warns instead of exiting 1, so an offline or failed fetch no longer breaks npm install https-tls; users keep the bundled file. The cron runs node scripts/postinstall.js --strict, which still exits 1, so a broken fetch fails the job and skips the healthcheck ping.

Follow-up

Healthcheck ping added after a successful run.

🤖 Generated with Claude Code


Note

Medium Risk
Automated commits and pushes to the default branch depend on secrets and upstream fetch reliability, though tests run before any commit.

Overview
Adds a scheduled GitHub Actions workflow (Mondays 00:00 UTC, plus manual dispatch) that refreshes src/headers-order.json from upstream apify/fingerprint-suite, runs npm test, commits build(update): headers order only when the file changes, pushes with GH_TOKEN, and pings a healthcheck on success.

scripts/postinstall.js now accepts --strict: normal installs warn and keep the bundled file if the fetch fails; the cron invokes node scripts/postinstall.js --strict so a failed update fails the job instead of silently continuing.

Reviewed by Cursor Bugbot for commit cc01773. Bugbot is set up for automated code reviews on this repo. Configure here.

Same shape as country-vat: run the postinstall fetcher, gate on the test
suite, commit `build(update): headers order` only when the file changed,
push with GH_TOKEN so main.yml releases the new data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https-tls

Details
Benchmark suite Current: cc01773 Previous: 6bae081 Ratio
sortHeaders chrome 103.6 ms (103.3-103.9) 103.9 ms (103.2-104.8) 1.00
sortHeaders firefox 90.5 ms (90.2-91.3) 90.1 ms (89.7-91.4) 1.00
sortHeaders safari 87.9 ms (87.3-89.2) 87.5 ms (86.5-89) 1.00
getBrowser top 100 user agents 324.2 ms (322.1-327.4) 324.3 ms (323.9-328.3) 1.00
tls options top 100 user agents 273.3 ms (257.5-275.6) 261.1 ms (259.1-273.7) 1.05

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 40734249320

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 99.653%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 248
Covered Lines: 248
Line Coverage: 100.0%
Relevant Branches: 40
Covered Branches: 39
Branch Coverage: 97.5%
Branches in Coverage %: Yes
Coverage Strength: 11.25 hits per line

💛 - Coveralls

A failed fetch (offline install, upstream down) used to exit 1 and break
`npm install https-tls`. It now warns and keeps the bundled file.

The cron runs it with --strict so a broken fetch still fails the job and
skips the healthcheck ping instead of passing silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kikobeats
Kikobeats merged commit d5326e4 into master Oct 28, 2026
3 checks passed
@Kikobeats
Kikobeats deleted the Kikobeats/headers-order-cron branch October 28, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant