actions-warden 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/AGENTS.md +199 -0
  2. package/CONTRIBUTING.md +109 -0
  3. package/README.md +284 -224
  4. package/RELEASING.md +338 -0
  5. package/SECURITY.md +30 -3
  6. package/docs/AI-AGENTS.md +474 -0
  7. package/docs/CLI.md +474 -0
  8. package/docs/CONFIGURATION.md +340 -0
  9. package/docs/DEVELOPMENT.md +373 -0
  10. package/docs/GITHUB-ACTION.md +285 -0
  11. package/docs/JAVASCRIPT-API.md +357 -0
  12. package/docs/OUTPUTS.md +414 -0
  13. package/docs/README.md +27 -0
  14. package/examples/org-scan.yml +42 -0
  15. package/examples/upgrade-pr.yml +57 -0
  16. package/llms.txt +38 -0
  17. package/package.json +32 -10
  18. package/skills/actions-warden/SKILL.md +151 -40
  19. package/src/action.js +306 -0
  20. package/src/cli.js +494 -56
  21. package/src/commands/audit.js +189 -36
  22. package/src/commands/org-scan.js +544 -0
  23. package/src/commands/pin.js +59 -56
  24. package/src/commands/report.js +122 -10
  25. package/src/commands/upgrade.js +102 -62
  26. package/src/commands/verify.js +193 -0
  27. package/src/index.js +21 -4
  28. package/src/lib/action-status.js +27 -0
  29. package/src/lib/agent-mode.js +174 -0
  30. package/src/lib/annotations.js +250 -0
  31. package/src/lib/baseline.js +103 -0
  32. package/src/lib/cache.js +47 -10
  33. package/src/lib/concurrency.js +27 -0
  34. package/src/lib/config.js +185 -0
  35. package/src/lib/execution.js +71 -0
  36. package/src/lib/formatter.js +127 -8
  37. package/src/lib/github-org.js +374 -0
  38. package/src/lib/identity.js +62 -0
  39. package/src/lib/ignore.js +7 -6
  40. package/src/lib/org-checkpoint.js +461 -0
  41. package/src/lib/org-progress.js +60 -0
  42. package/src/lib/parser.js +326 -52
  43. package/src/lib/patcher.js +199 -0
  44. package/src/lib/path-equality.js +30 -0
  45. package/src/lib/paths.js +35 -12
  46. package/src/lib/redact.js +65 -4
  47. package/src/lib/resolver.js +225 -43
  48. package/src/lib/targets.js +28 -0
  49. package/src/lib/triggers.js +12 -0
  50. package/src/lib/writer.js +48 -8
  51. package/src/rules/excessive-permissions.js +24 -33
  52. package/src/rules/index.js +19 -1
  53. package/src/rules/pull-request-target-checkout.js +149 -18
  54. package/src/rules/reusable-workflow-secrets.js +32 -0
  55. package/src/rules/script-injection.js +77 -12
  56. package/src/rules/secrets-in-env.js +101 -18
  57. package/src/rules/unpinned-action.js +3 -2
  58. package/src/rules/unpinned-container-image.js +39 -0
  59. package/src/rules/unpinned-docker-action.js +30 -0
  60. package/src/rules/untrusted-self-hosted-runner.js +109 -0
  61. package/src/rules/workflow-run-artifact-execution.js +122 -0
  62. package/src/rules/workflow-structure.js +396 -0
  63. package/src/version.js +3 -0
@@ -0,0 +1,414 @@
1
+ # Output contracts
2
+
3
+ actions-warden separates three concepts:
4
+
5
+ - the selected serialization format;
6
+ - the result's semantic `status`;
7
+ - the process exit code used by a shell or CI runner.
8
+
9
+ Automation should read all three deliberately.
10
+
11
+ ## Formats
12
+
13
+ | format | contract | use case |
14
+ |---|---|---|
15
+ | `toon` | Labeled, one-record-per-line text | Compact terminal or LLM context |
16
+ | `json` | Command-specific object with `schemaVersion: "1.0"` | Programmatic integrations |
17
+ | `text` | Bracketed, one-record-per-line text | Human-readable logs |
18
+ | `sarif` | SARIF 2.1.0 JSON | Code scanning and compatible tooling |
19
+
20
+ Select a format with `--format`. The default is `toon`.
21
+
22
+ All serialized values pass through credential redaction. Known token formats,
23
+ credential-shaped key/value pairs, private keys, JWTs, and likely high-entropy
24
+ secrets are replaced with `<redacted>`. Do not use the output as a secret
25
+ transport.
26
+
27
+ ## Status and exit codes
28
+
29
+ Every normal command result has semantic status `OK` or `FAIL`. TOON ends with
30
+ `STATUS: ...`; JSON has a top-level `status`; text ends with `==> ...`.
31
+
32
+ | command | `OK` | `FAIL` |
33
+ |---|---|---|
34
+ | `audit` | No unsuppressed findings | One or more findings |
35
+ | `pin` | Resolution and planning/writes had no errors | One or more errors |
36
+ | `upgrade` | Resolution and planning/writes had no errors | One or more errors |
37
+ | `verify` | No verification errors; warnings are allowed | One or more verification errors |
38
+ | `report` | Audit, pin plan, and upgrade plan are all `OK` | Any phase is `FAIL` |
39
+ | `org-scan` | No findings and no repository errors | Findings or repository errors |
40
+ | `rules` | Rule catalog rendered | Not applicable during a normal result |
41
+
42
+ The CLI maps results to process codes:
43
+
44
+ | code | meaning |
45
+ |---|---|
46
+ | `0` | Semantic status `OK` |
47
+ | `1` | Semantic status `FAIL`; inspect the emitted report |
48
+ | `2` | Invalid arguments, invalid policy, unsafe paths, or another invocation-level failure |
49
+
50
+ An invocation-level failure is written to stderr as `error: <message>`. Unknown
51
+ options, missing values, invalid choices, conflicting flags, malformed numeric
52
+ values, unsafe destinations, and a missing command all return `2`. The failure
53
+ may occur before a structured payload can be rendered, so do not assume stdout
54
+ contains JSON when the process exits `2`.
55
+
56
+ Organization-scan live progress is also a stderr-only channel. It never becomes
57
+ part of JSON, SARIF, TOON, or text stdout. `--progress=auto` enables it for an
58
+ interactive stderr, `always` enables it for redirected/CI logs, and `never`
59
+ disables it. GitHub Action organization scans show the same phase, repository,
60
+ retry, and completion updates in the step log by default.
61
+
62
+ ### Agent-mode receipt
63
+
64
+ `org-scan --agent-mode`, or `ACTIONS_WARDEN_MODE=agent`, defaults the complete
65
+ report to a guarded scope-keyed file. Its stdout is a separate bounded JSON
66
+ receipt:
67
+
68
+ ```js
69
+ {
70
+ schemaVersion: '1.0',
71
+ kind: 'actions-warden-agent-receipt',
72
+ command: 'org-scan',
73
+ organization: string,
74
+ status: 'OK' | 'FAIL',
75
+ summary: object,
76
+ report: {
77
+ path: string,
78
+ format: 'toon' | 'json' | 'text' | 'sarif'
79
+ },
80
+ checkpoint: {
81
+ path: string,
82
+ resumed: boolean
83
+ }
84
+ }
85
+ ```
86
+
87
+ `summary` is the normal bounded organization coverage and severity summary;
88
+ the receipt never embeds repository arrays, findings, or operational error
89
+ details. Read `report.path` for the complete evidence. The receipt remains JSON
90
+ even when an explicit format selects TOON, text, or SARIF for the saved report.
91
+ Status and process exit semantics are unchanged. An invocation error may occur
92
+ before a receipt exists.
93
+
94
+ Explicit `--output=stdout` overrides the file default. In that case stdout is
95
+ the complete report in the selected format and no agent receipt is appended.
96
+
97
+ A mutation plan may contain changes and still return `0`: proposed changes are
98
+ not errors. Conversely, `audit` may emit valid JSON and return `1`: findings are
99
+ the result of a successful scan.
100
+
101
+ ### Shell handling
102
+
103
+ Do not let `set -e` discard a valid finding report. Capture the exit code and
104
+ parse stdout for codes `0` and `1`:
105
+
106
+ ```sh
107
+ set +e
108
+ actions-warden audit --format=json > actions-warden.json
109
+ warden_status=$?
110
+ set -e
111
+
112
+ if [ "$warden_status" -eq 2 ]; then
113
+ echo "actions-warden could not complete" >&2
114
+ exit 2
115
+ fi
116
+
117
+ node -e '
118
+ const fs = require("node:fs");
119
+ const report = JSON.parse(fs.readFileSync("actions-warden.json", "utf8"));
120
+ console.log(report.status, report.summary.findings);
121
+ '
122
+ ```
123
+
124
+ Writing reports through a guarded output path is safer than shell redirection
125
+ when repository path containment matters. `--output-path` implies file output:
126
+
127
+ ```sh
128
+ actions-warden audit \
129
+ --format=json \
130
+ --output-path=reports/actions-warden.json
131
+ ```
132
+
133
+ The parent directory must exist. Destination safety is checked before command
134
+ work, then active policy and baseline collisions are checked again before the
135
+ report is written. Explicit `--output=stdout --output-path=...` is rejected.
136
+
137
+ ## TOON
138
+
139
+ TOON is Token-Oriented Object Notation. Each line is:
140
+
141
+ ```text
142
+ LABEL: key=value key=value
143
+ ```
144
+
145
+ Values containing whitespace, `=`, quotes, backslashes, or control characters
146
+ are JSON-quoted. Empty and null fields are omitted. Embedded newlines are
147
+ escaped, so inspected workflow content cannot forge another record.
148
+
149
+ Record labels by command:
150
+
151
+ | command | labels before the final status |
152
+ |---|---|
153
+ | `audit` | `SCAN`, `FINDING`, `SUMMARY` |
154
+ | `pin` | `PIN`, `ERROR`, `SUMMARY` |
155
+ | `upgrade` | `UPGRADE`, `SKIP`, `ERROR`, `SUMMARY` |
156
+ | `verify` | `VERIFIED`, `WARNING`, `ERROR`, `SUMMARY` |
157
+ | `report` | `FINDING`, `PIN`, `UPGRADE`, `SKIP`, `ERROR`, `SUMMARY` |
158
+ | `org-scan` | `REPOSITORY`, `FINDING`, `ERROR`, `SUMMARY` |
159
+ | `rules` | `RULE` |
160
+
161
+ Example:
162
+
163
+ ```text
164
+ SCAN: file=.github/workflows/ci.yml
165
+ FINDING: id=18b82e86d7c14fe2 type=unpinned-action sev=high file=.github/workflows/ci.yml action=actions/checkout@v5 line=14
166
+ SUMMARY: files=1 findings=1 totalFindings=1 suppressed=0 critical=0 high=1 medium=0 low=0
167
+ STATUS: FAIL
168
+ ```
169
+
170
+ Consumers should split only on the first `:`, then parse whitespace-delimited
171
+ `key=value` fields with JSON-string awareness. If a real parser is available,
172
+ prefer JSON rather than implementing a partial TOON parser.
173
+
174
+ ## JSON
175
+
176
+ JSON output is command-specific and ends with a newline. Every top-level object
177
+ contains:
178
+
179
+ ```json
180
+ {
181
+ "schemaVersion": "1.0",
182
+ "status": "OK"
183
+ }
184
+ ```
185
+
186
+ Treat `schemaVersion` as the compatibility switch and ignore unknown fields so
187
+ additive metadata does not break consumers.
188
+
189
+ ### Finding
190
+
191
+ Audit and organization findings use this core shape:
192
+
193
+ ```js
194
+ {
195
+ id: string, // stable source-occurrence ID
196
+ fingerprint: string, // line-independent baseline identity
197
+ ruleId: string,
198
+ severity: 'low' | 'medium' | 'high' | 'critical',
199
+ file: string, // POSIX-style path relative to the selected cwd
200
+ line: number,
201
+ fields: object, // rule-specific structured evidence
202
+ explain?: string
203
+ }
204
+ ```
205
+
206
+ Organization findings additionally include `repository`, `branch`, and `url`.
207
+ `fields.type`, `fields.sev`, and `fields.file` provide the equivalent flat
208
+ fields used by line-oriented formats.
209
+
210
+ ### `audit`
211
+
212
+ ```js
213
+ {
214
+ schemaVersion: '1.0',
215
+ files: string[],
216
+ findings: Finding[],
217
+ summary: {
218
+ files: number,
219
+ findings: number,
220
+ totalFindings: number,
221
+ suppressed: number,
222
+ critical: number,
223
+ high: number,
224
+ medium: number,
225
+ low: number
226
+ },
227
+ baseline: { path: string | null, suppressed: number },
228
+ configPath: string | null,
229
+ status: 'OK' | 'FAIL'
230
+ }
231
+ ```
232
+
233
+ ### `pin`
234
+
235
+ ```js
236
+ {
237
+ schemaVersion: '1.0',
238
+ dryRun: boolean,
239
+ changes: [{
240
+ id: string,
241
+ file: string,
242
+ action: string,
243
+ fromRef: string,
244
+ toSha: string,
245
+ line: number,
246
+ refType: 'tag' | 'branch' | 'commit'
247
+ }],
248
+ errors: object[],
249
+ status: 'OK' | 'FAIL'
250
+ }
251
+ ```
252
+
253
+ ### `upgrade`
254
+
255
+ ```js
256
+ {
257
+ schemaVersion: '1.0',
258
+ dryRun: boolean,
259
+ mode: 'major' | 'minor' | 'patch',
260
+ changes: [{
261
+ id: string,
262
+ file: string,
263
+ action: string,
264
+ fromRef: string,
265
+ fromVersion: string | null,
266
+ toTag: string,
267
+ toSha: string,
268
+ level: 'major' | 'minor' | 'patch' | 'unknown',
269
+ line: number
270
+ }],
271
+ skipped: object[],
272
+ errors: object[],
273
+ status: 'OK' | 'FAIL'
274
+ }
275
+ ```
276
+
277
+ ### `verify`
278
+
279
+ ```js
280
+ {
281
+ schemaVersion: '1.0',
282
+ files: string[],
283
+ checks: object[],
284
+ warnings: object[],
285
+ errors: object[],
286
+ status: 'OK' | 'FAIL'
287
+ }
288
+ ```
289
+
290
+ ### `report`
291
+
292
+ ```js
293
+ {
294
+ schemaVersion: '1.0',
295
+ audit: {
296
+ files: string[],
297
+ findings: Finding[],
298
+ summary: object,
299
+ baseline: object,
300
+ status: 'OK' | 'FAIL'
301
+ },
302
+ pin: {
303
+ changes: object[],
304
+ errors: object[],
305
+ status: 'OK' | 'FAIL'
306
+ },
307
+ upgrade: {
308
+ changes: object[],
309
+ skipped: object[],
310
+ errors: object[],
311
+ mode: 'major' | 'minor' | 'patch',
312
+ status: 'OK' | 'FAIL'
313
+ },
314
+ offline: boolean,
315
+ status: 'OK' | 'FAIL'
316
+ }
317
+ ```
318
+
319
+ ### `org-scan`
320
+
321
+ ```js
322
+ {
323
+ schemaVersion: '1.0',
324
+ organization: string,
325
+ scope: object,
326
+ repositories: [{
327
+ repository: {
328
+ owner: string,
329
+ name: string,
330
+ fullName: string,
331
+ defaultBranch: string | null,
332
+ visibility: 'public' | 'private' | 'internal',
333
+ private: boolean,
334
+ fork: boolean,
335
+ archived: boolean,
336
+ disabled: boolean,
337
+ htmlUrl: string
338
+ },
339
+ revision: { branch: string | null, treeSha: string | null },
340
+ files: string[],
341
+ findings: Finding[],
342
+ errors: object[],
343
+ summary: object,
344
+ status: 'OK' | 'FAIL'
345
+ }],
346
+ findings: Finding[], // flattened across repositories
347
+ errors: object[], // flattened across repositories
348
+ summary: object,
349
+ baseline: object,
350
+ configPath: string | null,
351
+ status: 'OK' | 'FAIL'
352
+ }
353
+ ```
354
+
355
+ The organization summary includes repository coverage counts in addition to
356
+ file, finding, suppression, error, and severity counts. A consumer can use the
357
+ flattened arrays for ingestion and the `repositories` array for coverage and
358
+ ownership views.
359
+
360
+ ### `rules`
361
+
362
+ ```js
363
+ {
364
+ schemaVersion: '1.0',
365
+ rules: [{
366
+ id: string,
367
+ severity: 'low' | 'medium' | 'high' | 'critical',
368
+ description: string
369
+ }],
370
+ status: 'OK'
371
+ }
372
+ ```
373
+
374
+ ## SARIF
375
+
376
+ SARIF output uses version 2.1.0 and identifies the tool as `actions-warden`.
377
+ Findings and operational records become SARIF results. Finding IDs and semantic
378
+ fingerprints are included as partial fingerprints where available, and source
379
+ locations use repository-relative POSIX paths.
380
+
381
+ For a local repository, upload the generated file with the code-scanning tool
382
+ used by your CI platform. Organization findings point at files in other
383
+ repositories, so a single organization SARIF artifact is best treated as a
384
+ portable report unless your ingestion system explicitly supports
385
+ cross-repository locations.
386
+
387
+ GitHub Action annotations are separate from the selected output format. Choosing
388
+ SARIF does not disable annotations.
389
+
390
+ ## Stable identities and ordering
391
+
392
+ Occurrence IDs exclude absolute checkout paths so a cloned repository produces
393
+ the same ID for unchanged source. A pin finding and its corresponding pin plan
394
+ share an ID, enabling a precise `--fix=<id>` handoff.
395
+
396
+ Baseline fingerprints tolerate line movement while distinguishing repeated,
397
+ semantically equivalent findings by source order.
398
+
399
+ File discovery, repository selection, findings, baseline serialization, and
400
+ JSON key construction are deterministic for unchanged inputs. Network-backed
401
+ commands can still change when GitHub refs, releases, default branches, or
402
+ repository access change.
403
+
404
+ Resuming an organization scan does not add execution-history fields to the
405
+ final report. When all validated repository revisions are unchanged, a resumed
406
+ report has the same serialized bytes as a fresh result with the same inputs.
407
+ Checkpoint and progress metadata stay outside the report contract.
408
+
409
+ ## GitHub Action outputs
410
+
411
+ The Action exposes `status`, `findings`, `report-path`, `annotations`, and
412
+ `annotations-skipped`. Its `fail-on-findings` input can allow audit findings to
413
+ leave the step successful, but operational errors always fail. See the
414
+ [GitHub Action guide](./GITHUB-ACTION.md#outputs-and-failure-policy).
package/docs/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Documentation
2
+
3
+ Use this page as the map for actions-warden's user, integration, and maintainer
4
+ documentation.
5
+
6
+ ## Use actions-warden
7
+
8
+ | Guide | Use it when |
9
+ |---|---|
10
+ | [CLI reference](./CLI.md) | Running audits, pinning, upgrades, verification, reports, or organization scans |
11
+ | [Configuration](./CONFIGURATION.md) | Defining policy, baselines, path exclusions, inline ignores, or runner trust |
12
+ | [Output contracts](./OUTPUTS.md) | Parsing JSON or TOON, uploading SARIF, or handling status and exit codes |
13
+ | [GitHub Action](./GITHUB-ACTION.md) | Adding repository or organization scanning to a workflow |
14
+ | [JavaScript API](./JAVASCRIPT-API.md) | Calling commands or parser utilities from Node.js |
15
+
16
+ ## Build with or contribute to actions-warden
17
+
18
+ | Guide | Use it when |
19
+ |---|---|
20
+ | [AI and coding agents](./AI-AGENTS.md) | Operating the CLI from an agent or integrating structured results into an AI workflow |
21
+ | [Developer guide](./DEVELOPMENT.md) | Understanding the architecture, tests, safety boundaries, and common change paths |
22
+ | [Contributing](../CONTRIBUTING.md) | Preparing a change or pull request |
23
+ | [Security policy](../SECURITY.md) | Reviewing the threat model or reporting a vulnerability |
24
+ | [Release process](../RELEASING.md) | Authorizing, publishing, monitoring, or recovering a maintainer/agent release |
25
+
26
+ The repository also provides [AGENTS.md](../AGENTS.md) for repository-aware
27
+ coding agents and [llms.txt](../llms.txt) as a compact machine-readable index.
@@ -0,0 +1,42 @@
1
+ name: actions-warden organization report
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: '23 7 * * 1'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ scan:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ steps:
17
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # actions-warden-ref: v5.0.0
18
+ with:
19
+ persist-credentials: false
20
+
21
+ - name: Scan organization workflows
22
+ uses: chiz0me/actions-warden@<FULL_COMMIT_SHA>
23
+ with:
24
+ command: org-scan
25
+ organization: ${{ github.repository_owner }}
26
+ token: ${{ secrets.ACTIONS_WARDEN_ORG_TOKEN }}
27
+ severity: high
28
+ explain: 'true'
29
+ format: json
30
+ output-path: actions-warden-org-report.json
31
+ checkpoint-path: .actions-warden-org-checkpoint.json
32
+ fail-on-findings: 'false'
33
+
34
+ - name: Upload organization report
35
+ if: always()
36
+ uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # actions-warden-ref: v5.0.0
37
+ with:
38
+ name: actions-warden-org-report
39
+ path: |
40
+ actions-warden-org-report.json
41
+ .actions-warden-org-checkpoint.json
42
+ if-no-files-found: error
@@ -0,0 +1,57 @@
1
+ name: actions-warden upgrades
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ - cron: '17 6 * * 1'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ upgrade:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write
16
+ pull-requests: write
17
+ steps:
18
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # actions-warden-ref: v5.0.0
19
+ with:
20
+ persist-credentials: false
21
+
22
+ - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # actions-warden-ref: v5.0.0
23
+ with:
24
+ node-version: '24'
25
+
26
+ - name: Apply eligible upgrades
27
+ env:
28
+ GITHUB_TOKEN: ${{ github.token }}
29
+ run: npx --yes actions-warden@0.4.0 upgrade --mode=minor --min-age=7 --write
30
+
31
+ - name: Open or update pull request
32
+ env:
33
+ GH_TOKEN: ${{ github.token }}
34
+ REPOSITORY: ${{ github.repository }}
35
+ UPGRADE_BRANCH: actions-warden/weekly-upgrades
36
+ run: |
37
+ set -euo pipefail
38
+ if git diff --quiet; then
39
+ echo "No eligible upgrades."
40
+ exit 0
41
+ fi
42
+
43
+ git config user.name "github-actions[bot]"
44
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
45
+ git add -u
46
+ git commit -m "chore: upgrade pinned GitHub Actions"
47
+ remote_sha="$(gh api "repos/${REPOSITORY}/git/ref/heads/${UPGRADE_BRANCH}" --jq .object.sha 2>/dev/null || true)"
48
+ lease="--force-with-lease=refs/heads/${UPGRADE_BRANCH}:${remote_sha}"
49
+ git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic $(printf 'x-access-token:%s' "$GH_TOKEN" | base64 -w0)" \
50
+ push "$lease" "https://github.com/${REPOSITORY}.git" "HEAD:refs/heads/${UPGRADE_BRANCH}"
51
+
52
+ if ! gh pr view "$UPGRADE_BRANCH" >/dev/null 2>&1; then
53
+ gh pr create \
54
+ --head "$UPGRADE_BRANCH" \
55
+ --title "chore: upgrade pinned GitHub Actions" \
56
+ --body "Automated, cooldown-aware upgrade generated by actions-warden."
57
+ fi
package/llms.txt ADDED
@@ -0,0 +1,38 @@
1
+ # actions-warden
2
+
3
+ > Audit GitHub Actions in one repository or across a GitHub organization, then
4
+ > pin, verify, and upgrade dependencies with explicit write authorization.
5
+
6
+ Requires Node.js 20+. The CLI is non-interactive. `pin` and `upgrade` are
7
+ dry-run by default. Normal JSON payloads use `schemaVersion: "1.0"`. Exit code
8
+ 1 is a completed `FAIL` result to inspect; exit code 2 is an invocation error.
9
+ Organization scans support guarded `--checkpoint` / `--resume` state and
10
+ stderr-only live progress while retaining fresh repository tree validation.
11
+ For agent-initiated organization scans, pass `--agent-mode` or set
12
+ `ACTIONS_WARDEN_MODE=agent`. It defaults to scope-keyed JSON report and
13
+ checkpoint files, compatible resume, no progress, and a bounded stdout receipt.
14
+ Preserve requested scope; do not load the complete report into model context.
15
+
16
+ ## Start
17
+
18
+ - [README](./README.md): product overview and quick start
19
+ - [CLI reference](./docs/CLI.md): commands, options, organization scans, cache
20
+ - [Configuration](./docs/CONFIGURATION.md): policy, rule IDs, ignores, baselines
21
+ - [Output contracts](./docs/OUTPUTS.md): JSON shapes, TOON, SARIF, status, exits
22
+ - [GitHub Action](./docs/GITHUB-ACTION.md): workflow setup, inputs, outputs
23
+ - [JavaScript API](./docs/JAVASCRIPT-API.md): public functions and renderers
24
+
25
+ ## AI and development
26
+
27
+ - [AI and coding agents](./docs/AI-AGENTS.md): safe plan/write/verify loop
28
+ - [Repository agent guidance](./AGENTS.md): invariants and validation
29
+ - [Developer guide](./docs/DEVELOPMENT.md): architecture and change recipes
30
+ - [Contributing](./CONTRIBUTING.md): setup and pull request checklist
31
+ - [Security policy](./SECURITY.md): threat model and private reporting
32
+ - [Release process](./RELEASING.md): authoritative maintainer/agent authorization, publication, verification, and recovery runbook
33
+
34
+ ## Copyable examples
35
+
36
+ - [Organization report workflow](./examples/org-scan.yml)
37
+ - [Upgrade pull request workflow](./examples/upgrade-pr.yml)
38
+ - [Claude Code skill](./skills/actions-warden/SKILL.md)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "actions-warden",
3
- "version": "0.2.0",
4
- "description": "Audit, pin, and upgrade GitHub Actions workflows. LLM-friendly TOON output, safe-by-default.",
3
+ "version": "0.4.0",
4
+ "description": "Audit GitHub Actions across repositories and organizations; pin, verify, and upgrade dependencies.",
5
5
  "author": "Naveen Yagati",
6
6
  "homepage": "https://github.com/chiz0me/actions-warden#readme",
7
7
  "repository": {
@@ -18,15 +18,23 @@
18
18
  "./commands/audit": "./src/commands/audit.js",
19
19
  "./commands/pin": "./src/commands/pin.js",
20
20
  "./commands/upgrade": "./src/commands/upgrade.js",
21
- "./commands/report": "./src/commands/report.js"
21
+ "./commands/report": "./src/commands/report.js",
22
+ "./commands/verify": "./src/commands/verify.js",
23
+ "./commands/org-scan": "./src/commands/org-scan.js"
22
24
  },
23
25
  "bin": {
24
26
  "actions-warden": "./src/cli.js"
25
27
  },
26
28
  "files": [
27
29
  "src",
30
+ "docs",
31
+ "examples",
28
32
  "skills",
29
33
  "README.md",
34
+ "CONTRIBUTING.md",
35
+ "AGENTS.md",
36
+ "RELEASING.md",
37
+ "llms.txt",
30
38
  "SECURITY.md",
31
39
  "LICENSE"
32
40
  ],
@@ -40,31 +48,45 @@
40
48
  "scripts": {
41
49
  "test": "vitest --run",
42
50
  "test:watch": "vitest",
43
- "lint": "eslint src test",
51
+ "lint": "eslint src scripts test",
52
+ "build:action": "ncc build src/action.js -o dist",
53
+ "check:action-bundle": "node scripts/verify-action-bundle.js",
54
+ "check:yaml": "node scripts/check-yaml.js",
55
+ "check:docs": "node scripts/check-docs.js",
56
+ "check:package": "node scripts/check-package.js",
57
+ "check:release-version": "node scripts/check-release-version.js",
44
58
  "verify-deps": "node scripts/verify-deps.js",
59
+ "verify-version-sync": "node scripts/verify-version-sync.js",
45
60
  "audit": "npm audit --audit-level=high",
46
- "release:verify": "npm run verify-deps && npm run lint && npm test && npm audit --audit-level=high && npm pack --dry-run",
47
- "prepublishOnly": "npm run release:verify"
61
+ "release:prepare": "node scripts/set-version.js",
62
+ "release:check": "npm run check:release-version && npm run verify-version-sync && npm run verify-deps && npm run check:yaml && npm run check:docs && npm run lint && npm test && npm audit --audit-level=high && npm run check:package && npm run check:action-bundle",
63
+ "prepublishOnly": "npm run verify-version-sync && npm run verify-deps && npm run check:yaml && npm run check:docs && npm run lint && npm test && npm audit --audit-level=high && npm run check:package"
48
64
  },
49
65
  "dependencies": {
50
66
  "commander": "14.0.3",
51
- "picomatch": "4.0.4",
52
- "semver": "7.8.1",
67
+ "picomatch": "4.0.5",
68
+ "semver": "7.8.5",
53
69
  "yaml": "2.9.0"
54
70
  },
55
71
  "devDependencies": {
56
- "eslint": "10.8.0",
57
- "vitest": "4.1.6"
72
+ "@eslint/js": "9.39.2",
73
+ "@vercel/ncc": "0.44.1",
74
+ "eslint": "9.39.2",
75
+ "globals": "17.7.0",
76
+ "vitest": "4.1.10"
58
77
  },
59
78
  "keywords": [
60
79
  "github-actions",
61
80
  "security",
62
81
  "audit",
82
+ "organization",
83
+ "security-report",
63
84
  "pin",
64
85
  "sha-pin",
65
86
  "workflow",
66
87
  "supply-chain",
67
88
  "toon",
89
+ "sarif",
68
90
  "llm"
69
91
  ],
70
92
  "license": "MIT"