Skip to content

Commit 5abaed3

Browse files
committed
feat(actions): return workflow artifact contents (#2329)
1 parent 3422703 commit 5abaed3

4 files changed

Lines changed: 651 additions & 14 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,15 +591,19 @@ The following sets of tools are available:
591591

592592
- **actions_get** - Get details of GitHub Actions resources (workflows, workflow runs, jobs, and artifacts)
593593
- **Required OAuth Scopes**: `repo`
594+
- `artifact_name`: Exact workflow artifact name to resolve within 'run_id' for 'download_workflow_run_artifact'. (string, optional)
595+
- `max_bytes`: Maximum number of bytes of text content to return per file when extracting 'download_workflow_run_artifact'. Defaults to 65536. (number, optional)
594596
- `method`: The method to execute (string, required)
595597
- `owner`: Repository owner (string, required)
598+
- `path`: Optional exact file path inside the artifact ZIP to return for 'download_workflow_run_artifact'. (string, optional)
596599
- `repo`: Repository name (string, required)
597600
- `resource_id`: The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID:
598601
- Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'get_workflow' method.
599602
- Provide a workflow run ID for 'get_workflow_run', 'get_workflow_run_usage', and 'get_workflow_run_logs_url' methods.
600-
- Provide an artifact ID for 'download_workflow_run_artifact' method.
603+
- Provide an artifact ID for 'download_workflow_run_artifact' to get a temporary download URL, or omit it and use 'run_id' plus 'artifact_name' to return artifact contents.
601604
- Provide a job ID for 'get_workflow_job' method.
602-
(string, required)
605+
(string, optional)
606+
- `run_id`: Workflow run ID used with 'artifact_name' to resolve and extract an artifact for 'download_workflow_run_artifact'. (number, optional)
603607

604608
- **actions_list** - List GitHub Actions workflows in a repository
605609
- **Required OAuth Scopes**: `repo`

pkg/github/__toolsnaps__/actions_get.snap

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
"description": "Get details about specific GitHub Actions resources.\nUse this tool to get details about individual workflows, workflow runs, jobs, and artifacts by their unique IDs.\n",
77
"inputSchema": {
88
"properties": {
9+
"artifact_name": {
10+
"description": "Exact workflow artifact name to resolve within 'run_id' for 'download_workflow_run_artifact'.",
11+
"type": "string"
12+
},
13+
"max_bytes": {
14+
"default": 65536,
15+
"description": "Maximum number of bytes of text content to return per file when extracting 'download_workflow_run_artifact'. Defaults to 65536.",
16+
"minimum": 1,
17+
"type": "number"
18+
},
919
"method": {
1020
"description": "The method to execute",
1121
"enum": [
@@ -22,20 +32,27 @@
2232
"description": "Repository owner",
2333
"type": "string"
2434
},
35+
"path": {
36+
"description": "Optional exact file path inside the artifact ZIP to return for 'download_workflow_run_artifact'.",
37+
"type": "string"
38+
},
2539
"repo": {
2640
"description": "Repository name",
2741
"type": "string"
2842
},
2943
"resource_id": {
30-
"description": "The unique identifier of the resource. This will vary based on the \"method\" provided, so ensure you provide the correct ID:\n- Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'get_workflow' method.\n- Provide a workflow run ID for 'get_workflow_run', 'get_workflow_run_usage', and 'get_workflow_run_logs_url' methods.\n- Provide an artifact ID for 'download_workflow_run_artifact' method.\n- Provide a job ID for 'get_workflow_job' method.\n",
44+
"description": "The unique identifier of the resource. This will vary based on the \"method\" provided, so ensure you provide the correct ID:\n- Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'get_workflow' method.\n- Provide a workflow run ID for 'get_workflow_run', 'get_workflow_run_usage', and 'get_workflow_run_logs_url' methods.\n- Provide an artifact ID for 'download_workflow_run_artifact' to get a temporary download URL, or omit it and use 'run_id' plus 'artifact_name' to return artifact contents.\n- Provide a job ID for 'get_workflow_job' method.\n",
3145
"type": "string"
46+
},
47+
"run_id": {
48+
"description": "Workflow run ID used with 'artifact_name' to resolve and extract an artifact for 'download_workflow_run_artifact'.",
49+
"type": "number"
3250
}
3351
},
3452
"required": [
3553
"method",
3654
"owner",
37-
"repo",
38-
"resource_id"
55+
"repo"
3956
],
4057
"type": "object"
4158
},

0 commit comments

Comments
 (0)