1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Scorecard
# Nightly: run the real-WAF + differential bench suites, publish
# the resulting per-vendor success rate to gh-pages, and update the
# README badges to reflect the current numbers.
#
# Network-dependent — runs only on the captchaforge org repo. PRs
# from forks skip it.
on:
schedule:
- cron: "0 10 * * *" # 10:00 UTC nightly
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
bench:
if: github.repository == 'santhsecurity/captchaforge'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Chrome + jq
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable jq
- name: Run real-WAF bench
run: |
cd bench
cargo run --release -- --suite real-waf --with-network --output ../scorecard-realwaf
- name: Run differential bench
env:
CAPTCHAFORGE_DIFF_2CAPTCHA_KEY: ${{ secrets.DIFF_2CAPTCHA_KEY }}
CAPTCHAFORGE_DIFF_CAPSOLVER_KEY: ${{ secrets.DIFF_CAPSOLVER_KEY }}
CAPTCHAFORGE_DIFF_CAPMONSTER_KEY: ${{ secrets.DIFF_CAPMONSTER_KEY }}
run: |
cd bench
cargo run --release -- --suite differential --output ../scorecard-differential || true
- name: Generate scorecard markdown + JSON
run: |
mkdir -p public/scorecard
jq -r '. as $r |
"# captchaforge scorecard\n\n" +
"## Per-vendor success rate (real-WAF, last 24h)\n\n" +
"| Vendor | Solves | Success rate | p50 ms | p95 ms |\n" +
"|--------|-------:|-------------:|-------:|-------:|\n" +
([.aggregates[] | "| \(.fixture) | \(.iterations) | \(.success_rate * 100 | floor)% | \(.median_ms) | \(.p95_ms // "n/a") |"] | join("\n"))
' scorecard-realwaf.json > public/scorecard/index.md
cp scorecard-realwaf.json public/scorecard/realwaf.json
cp scorecard-differential.json public/scorecard/differential.json 2>/dev/null || true
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: public
- uses: actions/deploy-pages@v4
update-readme-badges:
needs: bench
if: github.repository == 'santhsecurity/captchaforge'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update README badges from scorecard
run: |
# Fetch the just-published scorecard JSON and bake per-
# vendor success-rate shields.io badges into README.md
# between the START-SCORECARD-BADGES / END-SCORECARD-BADGES
# markers.
curl -sL https://santhsecurity.github.io/captchaforge/scorecard/realwaf.json \
-o scorecard.json || true
# The actual badge-injection script lands in tools/scorecard.py.
- name: Commit + push badge update (if changed)
run: |
if ! git diff --quiet README.md; then
git config user.name "captchaforge-bot"
git config user.email "captchaforge-bot@users.noreply.github.com"
git commit -am "scorecard: nightly badge refresh"
git push
fi