feat(actions): add Phase 3 read tools — list_workflow_run_artifacts & get_artifact#89
Merged
Merged
Conversation
… get_artifact (#8) Phase 3 of the Actions tool suite (#8), adding build-output visibility: - list_workflow_run_artifacts (listWorkflowRunArtifacts): artifacts of a run (ID, name, size, expiry), with an optional exact-name filter. - get_artifact (getArtifact): single artifact metadata — size, expiry, producing run, archive download URL. Settles the issue's artifact binary-handling concern as "URL + metadata only": artifacts are zip archives, and unpacking them in Workers would need a zip-decode dependency the Phase 2 log decision already avoided — so neither tool downloads or unzips; get_artifact surfaces the archive_download_url (an authenticated API endpoint) instead. Adds a formatBytes helper so artifact sizes render readably at any scale.
There was a problem hiding this comment.
Pull request overview
This PR adds Phase 3 of the Actions tool suite (per issue #8): build-output visibility through two new read-only tools. Both tools surface metadata only (no binary download/unzip), consistent with the project's design decision for handling zip archives in a Workers environment.
Changes:
- Added
list_workflow_run_artifactstool to list artifacts produced by a workflow run (ID, name, size, expiry) with optional name filter and pagination - Added
get_artifacttool to fetch single artifact metadata including size, expiry, producing workflow run, and the authenticated archive download URL - Updated README comparison table and tool table to reflect the new tools
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tools/actions.ts | Adds formatBytes helper and registers two new tools (list_workflow_run_artifacts, get_artifact) following existing patterns |
| test/actions.test.js | Adds tests covering happy path rendering, empty results, edge cases (null workflow_run, expired artifacts), and parameter forwarding |
| README.md | Updates both the feature comparison table (adds "artifacts" mention) and the tool table (adds two new tool entries) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
workflow_run and its id are both optional in the API schema, but only the block itself was null-guarded — a partial block would render a literal `undefined` in the "from run" line. Guard the id too so it falls back to "(unknown)", matching the existing head_branch / head_sha fallbacks. Flagged independently by both review layers on PR #89.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3 of the Actions tool suite (#8), adding build-output visibility:
list_workflow_run_artifacts— artifacts produced by a run (ID, name, size, expiry), with an optional exact-name filter.get_artifact— single artifact metadata: size, expiry, producing run, and the archive download URL.This settles the issue's artifact binary-handling concern as URL + metadata only: artifacts are zip archives, and unpacking them in Workers would require a zip-decode dependency that the Phase 2 log decision already avoided — so neither tool downloads or unzips anything.
get_artifactsurfaces thearchive_download_url(an authenticated API endpoint) instead.Test plan
actions/upload-artifact), the empty case against this repo's latest run, andget_artifactdetail output — all rendered as designed. Throwaway spec deleted after the run.Remaining phases (rerun / cancel / dispatch) tracked in #8.