mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2026-08-03 15:49:23 +02:00
feat(actions): add artifact listing and download (#210)
Adds the ability to list and download Gitea Actions artifacts. Extends the existing `actions_run_read` tool with four new methods rather than adding a separate tool, keeping artifacts alongside the runs/jobs/logs they belong to. ### New methods (`actions_run_read`) | Method | Description | Key params | | -------------------- | ------------------------------------------ | ------------------------------------------------------ | | `list_artifacts` | List all artifacts in a repository | `owner`, `repo`, optional `artifact_name` filter | | `list_run_artifacts` | List artifacts for one workflow run | `owner`, `repo`, `run_id` | | `get_artifact` | Get metadata for a single artifact | `owner`, `repo`, `artifact_id` | | `download_artifact` | Download an artifact's zip archive to disk | `owner`, `repo`, `artifact_id`, optional `output_path` |Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/210 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
@@ -90,3 +90,19 @@ func slimActionWorkflow(raw any) any {
|
||||
func slimActionWorkflows(raw any) any {
|
||||
return slimPaginated(raw, slimWorkflow)
|
||||
}
|
||||
|
||||
func slimArtifact(m map[string]any) map[string]any {
|
||||
return pick(m, "id", "name", "size_in_bytes", "expired",
|
||||
"created_at", "updated_at", "expires_at")
|
||||
}
|
||||
|
||||
func slimActionArtifact(raw any) any {
|
||||
if m, ok := raw.(map[string]any); ok {
|
||||
return slimArtifact(m)
|
||||
}
|
||||
return raw
|
||||
}
|
||||
|
||||
func slimActionArtifacts(raw any) any {
|
||||
return slimPaginated(raw, slimArtifact)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user