fix(storage): migrate GitHub artifact upload from deprecated v1-v3 API to v4#2612
Open
kiwamizamurai wants to merge 1 commit intodiggerhq:developfrom
Open
fix(storage): migrate GitHub artifact upload from deprecated v1-v3 API to v4#2612kiwamizamurai wants to merge 1 commit intodiggerhq:developfrom
kiwamizamurai wants to merge 1 commit intodiggerhq:developfrom
Conversation
…I to v4
The old implementation used the internal `_apis/pipelines/workflows/{runID}/artifacts?api-version=6.0-preview`
endpoint (via ACTIONS_RUNTIME_URL), which GitHub deprecated and removed, causing HTTP 400 errors.
Replace with the Artifacts v4 Twirp/JSON protocol (ACTIONS_RESULTS_URL based):
1. POST CreateArtifact → receive signed_upload_url
2. PUT file contents to the signed Azure Blob URL
3. POST FinalizeArtifact to commit the upload
Closes diggerhq#1702
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Fixes #1702
The old
StorePlanFileimplementation called_apis/pipelines/workflows/{runID}/artifacts?api-version=6.0-preview(viaACTIONS_RUNTIME_URL), which was the deprecated Artifacts v1-v3 internal API. GitHub has since removed this endpoint, causing HTTP 400 errors for anyone usingupload-plan-destination: github.This PR replaces the upload path with the Artifacts v4 Twirp/JSON protocol used by
@actions/artifactv2+:POST {ACTIONS_RESULTS_URL}/twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact→ receivesigned_upload_urlPUTfile contents to the signed Azure Blob URL (x-ms-blob-type: BlockBlob)POST .../FinalizeArtifactto commit the uploadThe download path (
DownloadLatestPlans,PlanExists,RetrievePlan) already uses the stable GitHub REST API (go-githubclient) and is unchanged.Changes
libs/storage/plan_storage.go: Replace deprecated v1-v3 upload logic inStorePlanFilewith v4 Twirp/JSON callsACTIONS_RESULTS_URL+GITHUB_RUN_ATTEMPT(new env vars available in all GitHub Actions runners)Test plan
go build ./libs/storage/...)GithubPlanStorage(env vars only available inside GitHub Actions runners); tested by running a workflow withupload-plan-destination: github🤖 Generated with Claude Code