Skip to content

Commit da6476d

Browse files
feat: add GitHub Actions tools for workflow management (#491)
* feat: add GitHub Actions tools for workflow management - Introduced new tools for managing GitHub Actions workflows, including listing workflows, running workflows, canceling workflow runs, and retrieving workflow run logs. - Updated README.md to include new `actions` toolset and detailed descriptions of the new tools. - Added comprehensive tests for the new functionality to ensure reliability and correctness. * feat: enhance GitHub Actions toolset with additional workflow management capabilities - Added new tools for managing GitHub Actions, including listing workflows, retrieving workflow run logs, and managing workflow runs. - Integrated the new `actions` toolset into the default toolset group for improved accessibility. * feat: enhance GetJobLogs functionality for improved job log retrieval - Added new tests for GetJobLogs, including scenarios for retrieving logs for both single jobs and failed jobs. - Updated GetJobLogs tool description to clarify its capabilities for fetching logs efficiently. - Implemented error handling for missing required parameters and optimized responses for failed job logs. - Introduced functionality to return actual log content instead of just URLs when requested. * feat: enhance GetJobLogs functionality for improved job log retrieval - Added new tests for GetJobLogs, including scenarios for retrieving logs for both single jobs and failed jobs. - Updated GetJobLogs tool description to clarify its capabilities for fetching logs efficiently. - Implemented error handling for missing required parameters and optimized responses for failed job logs. - Introduced functionality to return actual log content instead of just URLs when requested. * refactor: standardize parameter handling and read-only hints in GitHub Actions tools - Replaced instances of `requiredParam` with `RequiredParam` for consistency across all tools. - Updated `toBoolPtr` to `ToBoolPtr` in tool annotations to maintain uniformity in boolean pointer handling. - Ensured all tools in the GitHub Actions suite adhere to the new naming conventions for improved readability and maintainability. * docs: add missing actions toolset to Available Toolsets table * feat: enhance GitHub Actions tool descriptions with enumerated options - Updated descriptions for workflow run status and job filters to include enumerated options for clarity. - Improved documentation for better usability and understanding of available parameters. * feat: expand event type options in GitHub Actions tool descriptions - Enhanced the event parameter description in the ListWorkflowRuns function to include a comprehensive list of supported event types. - Improved clarity and usability for users by providing enumerated options for event types in the documentation. * feat: add support for running workflows by ID and filename in GitHub Actions tools - Introduced a new tool, RunWorkflowByFileName, to allow users to run workflows using the workflow filename. - Updated the existing RunWorkflow tool to accept a numeric workflow ID instead of a filename. - Enhanced tests to cover scenarios for both running workflows by ID and filename, including error handling for missing parameters. - Improved tool descriptions for clarity and usability. * feat: standardize repository parameter descriptions in GitHub Actions tools - Introduced constants for repository owner and name descriptions to enhance consistency across multiple tools. - Updated all relevant tools to use the new constants for improved clarity and maintainability in parameter descriptions. * feat: enhance GitHub Actions tools with user-friendly titles - Added user-friendly titles to tool annotations for various GitHub Actions tools, improving clarity and usability for end-users. - Updated descriptions for tools including ListWorkflows, ListWorkflowRuns, RunWorkflow, and others to include new titles for better identification and understanding of their functionalities. * feat: unify workflow execution in GitHub Actions tools - Refactored the RunWorkflow tool to accept both numeric workflow IDs and filenames, enhancing flexibility for users. - Updated the corresponding tests to reflect changes in parameter handling and added assertions for workflow type in responses. - Removed the separate RunWorkflowByFileName tool to streamline functionality and improve code maintainability. * fix: linting issues
1 parent 7da11c2 commit da6476d

File tree

4 files changed

+2449
-3
lines changed

4 files changed

+2449
-3
lines changed

README.md

Lines changed: 108 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ The following sets of tools are available (all are on by default):
265265

266266
| Toolset | Description |
267267
| ----------------------- | ------------------------------------------------------------- |
268+
| `actions` | GitHub Actions workflows and CI/CD operations |
268269
| `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |
269270
| `code_security` | Code scanning alerts and security features |
270271
| `issues` | Issue-related tools (create, read, update, comment) |
@@ -283,12 +284,12 @@ To specify toolsets you want available to the LLM, you can pass an allow-list in
283284
1. **Using Command Line Argument**:
284285

285286
```bash
286-
github-mcp-server --toolsets repos,issues,pull_requests,code_security
287+
github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
287288
```
288289

289290
2. **Using Environment Variable**:
290291
```bash
291-
GITHUB_TOOLSETS="repos,issues,pull_requests,code_security" ./github-mcp-server
292+
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
292293
```
293294

294295
The environment variable `GITHUB_TOOLSETS` takes precedence over the command line argument if both are provided.
@@ -300,7 +301,7 @@ When using Docker, you can pass the toolsets as environment variables:
300301
```bash
301302
docker run -i --rm \
302303
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
303-
-e GITHUB_TOOLSETS="repos,issues,pull_requests,code_security,experiments" \
304+
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
304305
ghcr.io/github/github-mcp-server
305306
```
306307

@@ -769,6 +770,110 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
769770
- `page`: Page number (number, optional)
770771
- `perPage`: Results per page (number, optional)
771772

773+
### Actions
774+
775+
- **list_workflows** - List workflows in a repository
776+
777+
- `owner`: Repository owner (string, required)
778+
- `repo`: Repository name (string, required)
779+
- `page`: Page number (number, optional)
780+
- `perPage`: Results per page (number, optional)
781+
782+
- **list_workflow_runs** - List workflow runs for a specific workflow
783+
784+
- `owner`: Repository owner (string, required)
785+
- `repo`: Repository name (string, required)
786+
- `workflow_id`: Workflow ID or filename (string, required)
787+
- `branch`: Filter by branch name (string, optional)
788+
- `event`: Filter by event type (string, optional)
789+
- `status`: Filter by run status (string, optional)
790+
- `page`: Page number (number, optional)
791+
- `perPage`: Results per page (number, optional)
792+
793+
- **run_workflow** - Trigger a workflow via workflow_dispatch event
794+
795+
- `owner`: Repository owner (string, required)
796+
- `repo`: Repository name (string, required)
797+
- `workflow_id`: Workflow ID or filename (string, required)
798+
- `ref`: Git reference (branch, tag, or SHA) (string, required)
799+
- `inputs`: Input parameters for the workflow (object, optional)
800+
801+
- **get_workflow_run** - Get details of a specific workflow run
802+
803+
- `owner`: Repository owner (string, required)
804+
- `repo`: Repository name (string, required)
805+
- `run_id`: Workflow run ID (number, required)
806+
807+
- **get_workflow_run_logs** - Download logs for a workflow run
808+
809+
- `owner`: Repository owner (string, required)
810+
- `repo`: Repository name (string, required)
811+
- `run_id`: Workflow run ID (number, required)
812+
813+
- **list_workflow_jobs** - List jobs for a workflow run
814+
815+
- `owner`: Repository owner (string, required)
816+
- `repo`: Repository name (string, required)
817+
- `run_id`: Workflow run ID (number, required)
818+
- `filter`: Filter by job status (string, optional)
819+
- `page`: Page number (number, optional)
820+
- `perPage`: Results per page (number, optional)
821+
822+
- **get_job_logs** - Download logs for a specific workflow job or efficiently get all failed job logs for a workflow run
823+
824+
- `owner`: Repository owner (string, required)
825+
- `repo`: Repository name (string, required)
826+
- `job_id`: Job ID (number, required for single job logs)
827+
- `run_id`: Workflow run ID (number, required when using failed_only)
828+
- `failed_only`: When true, gets logs for all failed jobs in run_id (boolean, optional)
829+
- `return_content`: Returns actual log content instead of URLs (boolean, optional)
830+
831+
- **rerun_workflow_run** - Re-run an entire workflow
832+
833+
- `owner`: Repository owner (string, required)
834+
- `repo`: Repository name (string, required)
835+
- `run_id`: Workflow run ID (number, required)
836+
- `enable_debug_logging`: Enable debug logging for the re-run (boolean, optional)
837+
838+
- **rerun_failed_jobs** - Re-run only the failed jobs in a workflow run
839+
840+
- `owner`: Repository owner (string, required)
841+
- `repo`: Repository name (string, required)
842+
- `run_id`: Workflow run ID (number, required)
843+
- `enable_debug_logging`: Enable debug logging for the re-run (boolean, optional)
844+
845+
- **cancel_workflow_run** - Cancel a running workflow
846+
847+
- `owner`: Repository owner (string, required)
848+
- `repo`: Repository name (string, required)
849+
- `run_id`: Workflow run ID (number, required)
850+
851+
- **list_workflow_run_artifacts** - List artifacts from a workflow run
852+
853+
- `owner`: Repository owner (string, required)
854+
- `repo`: Repository name (string, required)
855+
- `run_id`: Workflow run ID (number, required)
856+
- `page`: Page number (number, optional)
857+
- `perPage`: Results per page (number, optional)
858+
859+
- **download_workflow_run_artifact** - Get download URL for a specific artifact
860+
861+
- `owner`: Repository owner (string, required)
862+
- `repo`: Repository name (string, required)
863+
- `artifact_id`: Artifact ID (number, required)
864+
865+
- **delete_workflow_run_logs** - Delete logs for a workflow run
866+
867+
- `owner`: Repository owner (string, required)
868+
- `repo`: Repository name (string, required)
869+
- `run_id`: Workflow run ID (number, required)
870+
871+
- **get_workflow_run_usage** - Get usage metrics for a workflow run
872+
873+
- `owner`: Repository owner (string, required)
874+
- `repo`: Repository name (string, required)
875+
- `run_id`: Workflow run ID (number, required)
876+
772877
### Code Scanning
773878

774879
- **get_code_scanning_alert** - Get a code scanning alert

0 commit comments

Comments
 (0)