You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cdaea8e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,23 @@
1
1
# Changelog
2
2
3
+
## [v7.2.0] - 2026-04-23
4
+
### Added
5
+
- claude-agent
6
+
- New composite action wrapping `anthropics/claude-code-action` (SHA-pinned) for running a Claude Code agent in CI pipelines
7
+
- Accepts a `PROMPT`, an optional newline-separated list of `FILES` to expose, a `MODEL` override (default `claude-sonnet-4-6`), and an optional `GITHUB_TOKEN` for GitHub API operations
8
+
- Claude output is displayed in the GitHub Actions Step Summary
9
+
- trivy-claude-analysis
10
+
- New composite action that reads a Trivy JSON report and asks Claude to create one private draft GitHub security advisory per finding
11
+
- Takes a `JSON_FILE` path (from `trivy-scan-notify`'s `json_file` output in the same job, or from `actions/download-artifact` in a later job)
12
+
-`SEVERITIES` input (default `CRITICAL,HIGH`) controls which severity levels are processed; append `,MEDIUM` to include medium findings
13
+
- Advisories are deduplicated against existing drafts and processed in CRITICAL → HIGH → MEDIUM order
14
+
- Requires `repository-advisories: write` permission in the calling workflow
15
+
- Enables a two-job manual-approval pattern: job 1 scans and uploads the JSON artifact, job 2 (gated by a GitHub Environment with required reviewers) downloads the exact artifact and runs Claude — no re-scan, no state drift, no `EXIT_CODE: '0'` hack
16
+
### Changed
17
+
- trivy-scan-notify
18
+
- Now uploads the Trivy JSON report as a workflow artifact (14-day retention) in addition to the SARIF artifact
19
+
- Exposes outputs `critical`, `high`, `medium`, `json_file`, and `artifact_name` for chaining with `trivy-claude-analysis`
To run Claude on the scan results — either immediately in the same job, or after a manual approval step in a second job — see [`trivy-claude-analysis`](#trivy-claude-analysis) below.
Post-processing action that reads a Trivy JSON report and asks Claude to create **private draft** GitHub repository security advisories — one per finding, at the severities you choose. The Trivy-specific prompt (CVE handling, ecosystem mapping, deduplication) is versioned inside this action, so caller repositories never duplicate it.
482
+
483
+
> [!IMPORTANT]
484
+
> The calling workflow must grant `permissions: repository-advisories: write` for advisory creation to succeed.
485
+
486
+
This action is typically chained after [`trivy-scan-notify`](#trivy-scan-notify), which produces the JSON report and uploads it as a workflow artifact.
487
+
488
+
#### Inputs
489
+
490
+
| name | required | type | default | description |
| JSON_FILE | yes | string | | Path to the Trivy JSON report (e.g. `trivy-image.json`). Use `steps.<id>.outputs.json_file` from `trivy-scan-notify` in the same job. |
| TARGET | yes | string | | What was scanned (image reference or scan path) |
495
+
| SARIF_CATEGORY | no | string | `"trivy-<SCAN_TYPE>"` | SARIF category from the originating scan, used to link advisories to the Code Scanning report |
496
+
| SEVERITIES | no | string | `"CRITICAL,HIGH"` | Comma-separated severities. Append `,MEDIUM` to include medium findings. |
The JSON file is already on disk from `trivy-scan-notify`, so no re-scan is needed.
532
+
533
+
#### Example — two-job pattern with manual approval
534
+
535
+
This pattern gates the Claude analysis (and the Anthropic token cost) behind a human approval step. Job 1 runs the scan and posts finding counts to Mattermost. A reviewer approves job 2 only when Claude analysis is worth running. Job 2 operates on the **exact JSON** produced by job 1 (downloaded from the workflow artifact), so there is no re-scan and no risk of state drift.
536
+
537
+
> [!NOTE]
538
+
> Create a `security-review` environment in repo Settings → Environments and add required reviewers before using this pattern.
Run a [Claude Code](https://docs.anthropic.com/claude/claude-code) agent with a given prompt in a CI pipeline. Thin, opinionated wrapper around `anthropics/claude-code-action` with prompt composition, optional file exposure, model selection, and GitHub API access for operations such as creating security advisories.
587
+
588
+
> [!NOTE]
589
+
> The calling workflow must grant the permissions required for the operations Claude will perform. For security advisory creation, add `repository-advisories: write`.
590
+
591
+
#### Inputs
592
+
593
+
| name | required | type | default | description |
| MODEL | no | string | `"claude-sonnet-4-6"` | Claude model ID |
599
+
| GITHUB_TOKEN | no | string | | GitHub token forwarded to Claude for GitHub API operations (e.g. creating security advisories). Pass `secrets.GITHUB_TOKEN`. |
600
+
601
+
Claude's output is displayed in the GitHub Actions Step Summary (`display_report: true`).
Review the dependency list and create a private draft security advisory
619
+
for any known critical vulnerability you find.
620
+
FILES: |
621
+
package.json
622
+
requirements.txt
623
+
```
624
+
625
+
For Trivy scan post-processing, use the dedicated [`trivy-claude-analysis`](#trivy-claude-analysis) action instead of calling `claude-agent` directly — it keeps the Trivy-specific prompt versioned inside the iMio actions.
description: Run a Claude Code agent with a given prompt, optionally focusing on specific files. Thin wrapper around anthropics/claude-code-action with sensible CI defaults.
3
+
4
+
inputs:
5
+
PROMPT:
6
+
description: 'Instructions for Claude'
7
+
required: true
8
+
FILES:
9
+
description: 'Newline-separated list of file paths to expose to Claude (appended to the prompt as context)'
10
+
required: false
11
+
default: ''
12
+
ANTHROPIC_API_KEY:
13
+
description: 'Anthropic API key (pass secrets.ANTHROPIC_API_KEY from the calling workflow)'
14
+
required: true
15
+
MODEL:
16
+
description: 'Claude model ID'
17
+
required: false
18
+
default: 'claude-sonnet-4-6'
19
+
GITHUB_TOKEN:
20
+
description: 'GitHub token forwarded to Claude for GitHub API operations (e.g. creating security advisories). Requires the appropriate permissions in the calling workflow (e.g. repository-advisories: write).'
21
+
required: false
22
+
default: ''
23
+
24
+
runs:
25
+
using: 'composite'
26
+
steps:
27
+
- name: Compose prompt
28
+
id: compose
29
+
shell: bash
30
+
env:
31
+
PROMPT: ${{ inputs.PROMPT }}
32
+
FILES: ${{ inputs.FILES }}
33
+
run: |
34
+
FULL_PROMPT="$PROMPT"
35
+
if [ -n "$FILES" ]; then
36
+
FILES_LIST=$(printf '%s' "$FILES" | sed '/^[[:space:]]*$/d' | sed 's/^/- /')
37
+
FULL_PROMPT="${FULL_PROMPT}"$'\n\n'"Files to examine:"$'\n'"${FILES_LIST}"
0 commit comments