Skip to content

Commit 264f072

Browse files
committed
ci: support Hugging Face token for action smoke
1 parent 3bff226 commit 264f072

5 files changed

Lines changed: 36 additions & 1 deletion

File tree

.github/workflows/intentprobe-action-smoke.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
paths: |
3131
research/fixtures/scan_path/safe-weather-package
3232
fail-on: block
33+
hf-token: ${{ secrets.HF_TOKEN }}
3334

3435
- name: Poisoned fixture blocks
3536
id: poisoned
@@ -40,6 +41,7 @@ jobs:
4041
research/fixtures/scan_path/poisoned-skill
4142
fail-on: block
4243
local-files-only: "true"
44+
hf-token: ${{ secrets.HF_TOKEN }}
4345

4446
- name: Assert poisoned fixture was blocked
4547
if: steps.poisoned.outcome != 'failure'

action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ inputs:
3939
description: Set true to require the model to already exist in the runner cache.
4040
required: false
4141
default: "false"
42+
hf-token:
43+
description: Optional Hugging Face token used to avoid anonymous CI rate limits.
44+
required: false
45+
default: ""
4246

4347
runs:
4448
using: composite
@@ -56,6 +60,19 @@ runs:
5660
~/.cache/torch
5761
key: ${{ runner.os }}-intentprobe-${{ inputs.intentprobe-version }}-qwen25-05b-v1
5862

63+
- name: Configure optional Hugging Face token
64+
shell: bash
65+
env:
66+
INPUT_HF_TOKEN: ${{ inputs.hf-token }}
67+
run: |
68+
set -euo pipefail
69+
if [ -n "$INPUT_HF_TOKEN" ]; then
70+
{
71+
printf 'HF_TOKEN=%s\n' "$INPUT_HF_TOKEN"
72+
printf 'HUGGING_FACE_HUB_TOKEN=%s\n' "$INPUT_HF_TOKEN"
73+
} >> "$GITHUB_ENV"
74+
fi
75+
5976
- name: Install IntentProbe
6077
shell: bash
6178
run: |

docs/DEMO_SCRIPT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
paths: |
5656
.
5757
fail-on: block
58+
hf-token: ${{ secrets.HF_TOKEN }}
5859
```
5960
6061
For a narrower scan:
@@ -76,6 +77,8 @@ For a narrower scan:
7677
- The same scanner can run as a GitHub Action gate before a pull request
7778
merges.
7879
- Scan targets and results stay inside the local machine or GitHub runner.
80+
- CI can pass an optional Hugging Face secret so first-run model downloads do
81+
not depend on anonymous rate limits.
7982
8083
## What this does not prove
8184

docs/GITHUB_ACTION.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
paths: |
3232
.
3333
fail-on: block
34+
hf-token: ${{ secrets.HF_TOKEN }}
3435
```
3536
3637
Use `paths` to narrow the scan once you know where your agent tooling lives:
@@ -45,6 +46,7 @@ Use `paths` to narrow the scan once you know where your agent tooling lives:
4546
skills/**
4647
packages/**/package.json
4748
fail-on: block
49+
hf-token: ${{ secrets.HF_TOKEN }}
4850
```
4951

5052
## Inputs
@@ -59,6 +61,14 @@ Use `paths` to narrow the scan once you know where your agent tooling lives:
5961
| `max-files` | `200` | Maximum candidate files read under each scanned directory. |
6062
| `max-file-bytes` | `200000` | Maximum bytes read from each candidate file. |
6163
| `local-files-only` | `false` | Set `true` only when the runner cache already has the model. |
64+
| `hf-token` | empty | Optional Hugging Face token passed as a GitHub secret to avoid anonymous download rate limits. |
65+
66+
## Optional Hugging Face token
67+
68+
The scanner runs locally in the GitHub Actions runner, but the first
69+
model-backed scan downloads Qwen2.5-0.5B from Hugging Face. Public runners can
70+
hit anonymous rate limits, so CI workflows should add an `HF_TOKEN` repository
71+
secret and pass it with `hf-token: ${{ secrets.HF_TOKEN }}`.
6272

6373
## What gets uploaded?
6474

docs/V0_2_DEMO_PACK.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Done:
3434
landscape.
3535
- GitHub Action metadata and workflow docs added for CI gating.
3636
- No-video demo script added for copy-paste CLI and Action proof.
37+
- Action supports an optional Hugging Face token secret for reliable first-run
38+
model downloads in CI.
3739

3840
Not done yet:
3941

@@ -49,7 +51,7 @@ Not done yet:
4951
| Milestone | Status | Evidence target |
5052
|---|---|---|
5153
| M0. One-command install | Done | PyPI package installs and scans locally. |
52-
| M1. CI gate | In progress | `action.yml`, docs, and one green action run. |
54+
| M1. CI gate | In progress | `action.yml`, docs, optional HF token, and one green action run. |
5355
| M2. No-video demo | In progress | `docs/DEMO_SCRIPT.md` plus action smoke workflow. |
5456
| M3. Demo repo | Next | A tiny MCP repo with one safe PR and one poisoned PR. |
5557
| M4. Runtime receipt demo | Next | `serve-jsonl` demo showing allow/warn/block receipts. |
@@ -159,3 +161,4 @@ Do not say:
159161
| 2026-06-08 | Build GitHub Action before more posting. | CI turns IntentProbe from "try this CLI" into an admission gate people can wire into repos. |
160162
| 2026-06-08 | Keep the public pack framed as a demo/evidence pack. | It still serves the acquisition path, but reads better to users, partners, and buyers. |
161163
| 2026-06-08 | Defer video and prioritize runnable proof. | Security scanner videos are low-signal; action smoke, demo script, and reproducible commands create stronger trust. |
164+
| 2026-06-08 | Add optional `hf-token` input to the Action. | The first public action smoke hit Hugging Face anonymous rate limits; CI should use a secret without uploading scan content anywhere. |

0 commit comments

Comments
 (0)