🌐 AI搜索 & 代理 主页
Skip to content

Commit 55f4c85

Browse files
committed
initial actions toolset backport
1 parent 5da71e3 commit 55f4c85

File tree

9 files changed

+1288
-1475
lines changed

9 files changed

+1288
-1475
lines changed

README.md

Lines changed: 30 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -490,94 +490,49 @@ The following sets of tools are available:
490490

491491
<summary>Actions</summary>
492492

493-
- **cancel_workflow_run** - Cancel workflow run
493+
- **actions_get** - Get details of GitHub Actions resources (workflows, workflow runs, jobs, and artifacts)
494+
- `method`: The method to execute (string, required)
494495
- `owner`: Repository owner (string, required)
495496
- `repo`: Repository name (string, required)
496-
- `run_id`: The unique identifier of the workflow run (number, required)
497+
- `resource_id`: The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID:
498+
- Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'get_workflow' method.
499+
- Provide a workflow run ID for 'get_workflow_run', 'get_workflow_run_usage', and 'get_workflow_run_logs_url' methods.
500+
- Provide an artifact ID for 'download_workflow_run_artifact' method.
501+
- Provide a job ID for 'get_workflow_job' method.
502+
(string, required)
497503

498-
- **delete_workflow_run_logs** - Delete workflow logs
504+
- **actions_list** - List GitHub Actions workflows in a repository
505+
- `method`: The action to perform (string, required)
499506
- `owner`: Repository owner (string, required)
507+
- `page`: Page number for pagination (default: 1) (number, optional)
508+
- `per_page`: Results per page for pagination (default: 30, max: 100) (number, optional)
500509
- `repo`: Repository name (string, required)
501-
- `run_id`: The unique identifier of the workflow run (number, required)
502-
503-
- **download_workflow_run_artifact** - Download workflow artifact
504-
- `artifact_id`: The unique identifier of the artifact (number, required)
510+
- `resource_id`: The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID:
511+
- Do not provide any resource ID for 'list_workflows' method.
512+
- Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'list_workflow_runs' method.
513+
- Provide a workflow run ID for 'list_workflow_jobs' and 'list_workflow_run_artifacts' methods.
514+
(string, optional)
515+
- `workflow_jobs_filter`: Filters for workflow jobs. **ONLY** used when method is 'list_workflow_jobs' (object, optional)
516+
- `workflow_runs_filter`: Filters for workflow runs. **ONLY** used when method is 'list_workflow_runs' (object, optional)
517+
518+
- **actions_run_trigger** - Trigger GitHub Actions workflow actions
519+
- `inputs`: Inputs the workflow accepts. Only used for 'run_workflow' method. (object, optional)
520+
- `method`: The method to execute (string, required)
505521
- `owner`: Repository owner (string, required)
522+
- `ref`: The git reference for the workflow. The reference can be a branch or tag name. Required for 'run_workflow' method. (string, optional)
506523
- `repo`: Repository name (string, required)
524+
- `run_id`: The ID of the workflow run. Required for all methods except 'run_workflow'. (number, optional)
525+
- `workflow_id`: The workflow ID (numeric) or workflow file name (e.g., main.yml, ci.yaml). Required for 'run_workflow' method. (string, optional)
507526

508-
- **get_job_logs** - Get job logs
509-
- `failed_only`: When true, gets logs for all failed jobs in run_id (boolean, optional)
510-
- `job_id`: The unique identifier of the workflow job (required for single job logs) (number, optional)
527+
- **get_job_logs** - Get GitHub Actions workflow job logs
528+
- `failed_only`: When true, gets logs for all failed jobs in the workflow run specified by run_id. Requires run_id to be provided. (boolean, optional)
529+
- `job_id`: The unique identifier of the workflow job. Required when getting logs for a single job. (number, optional)
511530
- `owner`: Repository owner (string, required)
512531
- `repo`: Repository name (string, required)
513532
- `return_content`: Returns actual log content instead of URLs (boolean, optional)
514-
- `run_id`: Workflow run ID (required when using failed_only) (number, optional)
533+
- `run_id`: The unique identifier of the workflow run. Required when failed_only is true to get logs for all failed jobs in the run. (number, optional)
515534
- `tail_lines`: Number of lines to return from the end of the log (number, optional)
516535

517-
- **get_workflow_run** - Get workflow run
518-
- `owner`: Repository owner (string, required)
519-
- `repo`: Repository name (string, required)
520-
- `run_id`: The unique identifier of the workflow run (number, required)
521-
522-
- **get_workflow_run_logs** - Get workflow run logs
523-
- `owner`: Repository owner (string, required)
524-
- `repo`: Repository name (string, required)
525-
- `run_id`: The unique identifier of the workflow run (number, required)
526-
527-
- **get_workflow_run_usage** - Get workflow usage
528-
- `owner`: Repository owner (string, required)
529-
- `repo`: Repository name (string, required)
530-
- `run_id`: The unique identifier of the workflow run (number, required)
531-
532-
- **list_workflow_jobs** - List workflow jobs
533-
- `filter`: Filters jobs by their completed_at timestamp (string, optional)
534-
- `owner`: Repository owner (string, required)
535-
- `page`: Page number for pagination (min 1) (number, optional)
536-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
537-
- `repo`: Repository name (string, required)
538-
- `run_id`: The unique identifier of the workflow run (number, required)
539-
540-
- **list_workflow_run_artifacts** - List workflow artifacts
541-
- `owner`: Repository owner (string, required)
542-
- `page`: Page number for pagination (min 1) (number, optional)
543-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
544-
- `repo`: Repository name (string, required)
545-
- `run_id`: The unique identifier of the workflow run (number, required)
546-
547-
- **list_workflow_runs** - List workflow runs
548-
- `actor`: Returns someone's workflow runs. Use the login for the user who created the workflow run. (string, optional)
549-
- `branch`: Returns workflow runs associated with a branch. Use the name of the branch. (string, optional)
550-
- `event`: Returns workflow runs for a specific event type (string, optional)
551-
- `owner`: Repository owner (string, required)
552-
- `page`: Page number for pagination (min 1) (number, optional)
553-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
554-
- `repo`: Repository name (string, required)
555-
- `status`: Returns workflow runs with the check run status (string, optional)
556-
- `workflow_id`: The workflow ID or workflow file name (string, required)
557-
558-
- **list_workflows** - List workflows
559-
- `owner`: Repository owner (string, required)
560-
- `page`: Page number for pagination (min 1) (number, optional)
561-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
562-
- `repo`: Repository name (string, required)
563-
564-
- **rerun_failed_jobs** - Rerun failed jobs
565-
- `owner`: Repository owner (string, required)
566-
- `repo`: Repository name (string, required)
567-
- `run_id`: The unique identifier of the workflow run (number, required)
568-
569-
- **rerun_workflow_run** - Rerun workflow run
570-
- `owner`: Repository owner (string, required)
571-
- `repo`: Repository name (string, required)
572-
- `run_id`: The unique identifier of the workflow run (number, required)
573-
574-
- **run_workflow** - Run workflow
575-
- `inputs`: Inputs the workflow accepts (object, optional)
576-
- `owner`: Repository owner (string, required)
577-
- `ref`: The git reference for the workflow. The reference can be a branch or tag name. (string, required)
578-
- `repo`: Repository name (string, required)
579-
- `workflow_id`: The workflow ID (numeric) or workflow file name (e.g., main.yml, ci.yaml) (string, required)
580-
581536
</details>
582537

583538
<details>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "Get details of GitHub Actions resources (workflows, workflow runs, jobs, and artifacts)"
5+
},
6+
"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",
7+
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"method",
11+
"owner",
12+
"repo",
13+
"resource_id"
14+
],
15+
"properties": {
16+
"method": {
17+
"type": "string",
18+
"description": "The method to execute",
19+
"enum": [
20+
"get_workflow",
21+
"get_workflow_run",
22+
"get_workflow_job",
23+
"download_workflow_run_artifact",
24+
"get_workflow_run_usage",
25+
"get_workflow_run_logs_url"
26+
]
27+
},
28+
"owner": {
29+
"type": "string",
30+
"description": "Repository owner"
31+
},
32+
"repo": {
33+
"type": "string",
34+
"description": "Repository name"
35+
},
36+
"resource_id": {
37+
"type": "string",
38+
"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"
39+
}
40+
}
41+
},
42+
"name": "actions_get"
43+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "List GitHub Actions workflows in a repository"
5+
},
6+
"description": "Tools for listing GitHub Actions resources.\nUse this tool to list workflows in a repository, or list workflow runs, jobs, and artifacts for a specific workflow or workflow run.\n",
7+
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"method",
11+
"owner",
12+
"repo"
13+
],
14+
"properties": {
15+
"method": {
16+
"type": "string",
17+
"description": "The action to perform",
18+
"enum": [
19+
"list_workflows",
20+
"list_workflow_runs",
21+
"list_workflow_jobs",
22+
"list_workflow_run_artifacts"
23+
]
24+
},
25+
"owner": {
26+
"type": "string",
27+
"description": "Repository owner"
28+
},
29+
"page": {
30+
"type": "number",
31+
"description": "Page number for pagination (default: 1)",
32+
"minimum": 1
33+
},
34+
"per_page": {
35+
"type": "number",
36+
"description": "Results per page for pagination (default: 30, max: 100)",
37+
"minimum": 1,
38+
"maximum": 100
39+
},
40+
"repo": {
41+
"type": "string",
42+
"description": "Repository name"
43+
},
44+
"resource_id": {
45+
"type": "string",
46+
"description": "The unique identifier of the resource. This will vary based on the \"method\" provided, so ensure you provide the correct ID:\n- Do not provide any resource ID for 'list_workflows' method.\n- Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'list_workflow_runs' method.\n- Provide a workflow run ID for 'list_workflow_jobs' and 'list_workflow_run_artifacts' methods.\n"
47+
},
48+
"workflow_jobs_filter": {
49+
"type": "object",
50+
"description": "Filters for workflow jobs. **ONLY** used when method is 'list_workflow_jobs'",
51+
"properties": {
52+
"filter": {
53+
"type": "string",
54+
"description": "Filters jobs by their completed_at timestamp",
55+
"enum": [
56+
"latest",
57+
"all"
58+
]
59+
}
60+
}
61+
},
62+
"workflow_runs_filter": {
63+
"type": "object",
64+
"description": "Filters for workflow runs. **ONLY** used when method is 'list_workflow_runs'",
65+
"properties": {
66+
"actor": {
67+
"type": "string",
68+
"description": "Filter to a specific GitHub user's workflow runs."
69+
},
70+
"branch": {
71+
"type": "string",
72+
"description": "Filter workflow runs to a specific Git branch. Use the name of the branch."
73+
},
74+
"event": {
75+
"type": "string",
76+
"description": "Filter workflow runs to a specific event type",
77+
"enum": [
78+
"branch_protection_rule",
79+
"check_run",
80+
"check_suite",
81+
"create",
82+
"delete",
83+
"deployment",
84+
"deployment_status",
85+
"discussion",
86+
"discussion_comment",
87+
"fork",
88+
"gollum",
89+
"issue_comment",
90+
"issues",
91+
"label",
92+
"merge_group",
93+
"milestone",
94+
"page_build",
95+
"public",
96+
"pull_request",
97+
"pull_request_review",
98+
"pull_request_review_comment",
99+
"pull_request_target",
100+
"push",
101+
"registry_package",
102+
"release",
103+
"repository_dispatch",
104+
"schedule",
105+
"status",
106+
"watch",
107+
"workflow_call",
108+
"workflow_dispatch",
109+
"workflow_run"
110+
]
111+
},
112+
"status": {
113+
"type": "string",
114+
"description": "Filter workflow runs to only runs with a specific status",
115+
"enum": [
116+
"queued",
117+
"in_progress",
118+
"completed",
119+
"requested",
120+
"waiting"
121+
]
122+
}
123+
}
124+
}
125+
}
126+
},
127+
"name": "actions_list"
128+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": true,
4+
"title": "Trigger GitHub Actions workflow actions"
5+
},
6+
"description": "Trigger GitHub Actions workflow operations, including running, re-running, cancelling workflow runs, and deleting workflow run logs.",
7+
"inputSchema": {
8+
"type": "object",
9+
"required": [
10+
"method",
11+
"owner",
12+
"repo"
13+
],
14+
"properties": {
15+
"inputs": {
16+
"type": "object",
17+
"description": "Inputs the workflow accepts. Only used for 'run_workflow' method."
18+
},
19+
"method": {
20+
"type": "string",
21+
"description": "The method to execute",
22+
"enum": [
23+
"run_workflow",
24+
"rerun_workflow_run",
25+
"rerun_failed_jobs",
26+
"cancel_workflow_run",
27+
"delete_workflow_run_logs"
28+
]
29+
},
30+
"owner": {
31+
"type": "string",
32+
"description": "Repository owner"
33+
},
34+
"ref": {
35+
"type": "string",
36+
"description": "The git reference for the workflow. The reference can be a branch or tag name. Required for 'run_workflow' method."
37+
},
38+
"repo": {
39+
"type": "string",
40+
"description": "Repository name"
41+
},
42+
"run_id": {
43+
"type": "number",
44+
"description": "The ID of the workflow run. Required for all methods except 'run_workflow'."
45+
},
46+
"workflow_id": {
47+
"type": "string",
48+
"description": "The workflow ID (numeric) or workflow file name (e.g., main.yml, ci.yaml). Required for 'run_workflow' method."
49+
}
50+
}
51+
},
52+
"name": "actions_run_trigger"
53+
}

pkg/github/__toolsnaps__/get_job_logs.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"annotations": {
33
"readOnlyHint": true,
4-
"title": "Get job logs"
4+
"title": "Get GitHub Actions workflow job logs"
55
},
6-
"description": "Download logs for a specific workflow job or efficiently get all failed job logs for a workflow run",
6+
"description": "Get logs for GitHub Actions workflow jobs.\nUse this tool to retrieve logs for a specific job or all failed jobs in a workflow run.\nFor single job logs, provide job_id. For all failed jobs in a run, provide run_id with failed_only=true.\n",
77
"inputSchema": {
88
"type": "object",
99
"required": [
@@ -13,11 +13,11 @@
1313
"properties": {
1414
"failed_only": {
1515
"type": "boolean",
16-
"description": "When true, gets logs for all failed jobs in run_id"
16+
"description": "When true, gets logs for all failed jobs in the workflow run specified by run_id. Requires run_id to be provided."
1717
},
1818
"job_id": {
1919
"type": "number",
20-
"description": "The unique identifier of the workflow job (required for single job logs)"
20+
"description": "The unique identifier of the workflow job. Required when getting logs for a single job."
2121
},
2222
"owner": {
2323
"type": "string",
@@ -33,7 +33,7 @@
3333
},
3434
"run_id": {
3535
"type": "number",
36-
"description": "Workflow run ID (required when using failed_only)"
36+
"description": "The unique identifier of the workflow run. Required when failed_only is true to get logs for all failed jobs in the run."
3737
},
3838
"tail_lines": {
3939
"type": "number",

0 commit comments

Comments
 (0)