feat: update upload-asset to use GitHub Actions artifact API with temporary IDs#21645
feat: update upload-asset to use GitHub Actions artifact API with temporary IDs#21645
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…porary IDs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
… skipped state Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main and recompile |
Done. Merged main (including the MCP gateway v0.1.18 bump and ecosystem domain fixes) into this branch, resolved conflicts (keeping our temporary ID approach), rebuilt the binary, and recompiled all 175 workflows. Golden test files updated accordingly. Commit: 8c49f16. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Updates the upload_asset safe-outputs flow to return a temporary asset ID and later resolve it to a GitHub Actions artifact URL before publishing issues/comments/discussions.
Changes:
- Update user-facing tool/prompt descriptions to document temporary asset IDs (
aw_...) and markdown usage. - Pass an
asset_url_mapfromupload_assetstosafe_outputsand perform asset-ID → URL substitution before publishing content. - Remove
GH_AW_ASSETS_BRANCHfrom generated environments and recompile/refresh workflow fixtures and lockfiles accordingly.
Reviewed changes
Copilot reviewed 201 out of 201 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/unified_prompt_step.go | Updates prompt guidance for upload_asset to describe temporary asset IDs and markdown usage. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/with-imports.golden | Updates golden fixture to remove GH_AW_ASSETS_BRANCH passthrough. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/smoke-test-tools.golden | Updates golden fixture to remove GH_AW_ASSETS_BRANCH passthrough. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/smoke-copilot.golden | Updates golden fixture to remove GH_AW_ASSETS_BRANCH passthrough. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/claude-with-network.golden | Updates golden fixture to remove GH_AW_ASSETS_BRANCH passthrough. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/basic-copilot.golden | Updates golden fixture to remove GH_AW_ASSETS_BRANCH passthrough. |
| pkg/workflow/safe_outputs_env.go | Removes branch env var; keeps max-size/ext allowlist env vars for handler validation. |
| pkg/workflow/safe_output_helpers_test.go | Updates env-var expectations to drop GH_AW_ASSETS_BRANCH. |
| pkg/workflow/publish_assets_test.go | Updates tests for config parsing/output expectations and asserts asset_url_map output wiring. |
| pkg/workflow/mcp_setup_generator.go | Removes GH_AW_ASSETS_BRANCH from MCP gateway env passthrough list. |
| pkg/workflow/mcp_environment.go | Stops exporting GH_AW_ASSETS_BRANCH into MCP tool environment. |
| pkg/workflow/js/safe_outputs_tools.json | Updates upload_asset tool description to temporary-ID + artifact-based behavior. |
| pkg/workflow/compiler_safe_outputs_job.go | Adds upload_assets dependency/condition and passes GH_AW_ASSET_URL_MAP into safe_outputs. |
| pkg/workflow/compiler_safe_outputs_config.go | Stops emitting branch config for upload-assets handler. |
| pkg/workflow/compiler_main_job.go | Removes GH_AW_ASSETS_BRANCH from main job env defaults. |
| pkg/workflow/codex_engine.go | Removes GH_AW_ASSETS_BRANCH from the safe-outputs env allowlist/policy. |
| actions/setup/js/temporary_id.cjs | Adds asset URL map loading and (aw_...) URL-position replacement helper(s). |
| actions/setup/js/safe_outputs_tools.json | Updates upload_asset tool description to temporary-ID + artifact-based behavior. |
| actions/setup/js/create_issue.cjs | Resolves asset IDs to artifact URLs in issue bodies prior to publishing. |
| actions/setup/js/create_discussion.cjs | Resolves asset IDs to artifact URLs in discussion bodies prior to publishing. |
| actions/setup/js/add_comment.cjs | Resolves asset IDs to artifact URLs in comment bodies prior to publishing. |
| .github/workflows/workflow-normalizer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/workflow-health-manager.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/workflow-generator.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/video-analyzer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/update-astro.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/ubuntu-image-analyzer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/typist.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/tidy.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/test-workflow.lock.yml | Removes GH_AW_ASSETS_BRANCH from MCP gateway command passthrough. |
| .github/workflows/test-project-url-default.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/test-dispatcher.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/test-create-pr-error-handling.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/terminal-stylist.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/super-linter.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/step-name-alignment.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/static-analysis-report.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/smoke-test-tools.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/smoke-project.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/sergo.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/semantic-function-refactor.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/security-review.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/security-compliance.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/scout.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/schema-consistency-checker.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/safe-output-health.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/research.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/repo-tree-map.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/release.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/refiner.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/q.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/prompt-clustering-analysis.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/pr-triage-agent.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/plan.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/pdf-summary.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/metrics-collector.lock.yml | Removes GH_AW_ASSETS_BRANCH from MCP gateway command passthrough. |
| .github/workflows/mergefest.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/lockfile-stats.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/layout-spec-maintainer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/jsweep.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/issue-monster.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/instructions-janitor.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/hourly-ci-cleaner.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/grumpy-reviewer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/gpclean.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/go-pattern-detector.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/go-fan.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/github-mcp-tools-report.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/firewall.lock.yml | Removes GH_AW_ASSETS_BRANCH from MCP gateway command passthrough. |
| .github/workflows/firewall-escape.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/example-workflow-analyzer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/example-permissions-warning.lock.yml | Removes GH_AW_ASSETS_BRANCH from MCP gateway command passthrough. |
| .github/workflows/draft-pr-cleanup.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/discussion-task-miner.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/dev.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/dev-hawk.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/delight.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/dead-code-remover.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-team-status.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-security-red-team.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-secrets-analysis.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-safe-output-optimizer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-function-namer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-file-diet.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-compiler-quality.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/daily-choice-test.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/craft.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/copilot-agent-analysis.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/contribution-check.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/commit-changes-analyzer.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/codex-github-remote-mcp-test.lock.yml | Removes GH_AW_ASSETS_BRANCH from MCP gateway command passthrough. |
| .github/workflows/code-simplifier.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/cloclo.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/cli-version-checker.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/ci-doctor.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/ci-coach.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/brave.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/bot-detection.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/blog-auditor.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/artifacts-summary.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/archie.lock.yml | Removes GH_AW_ASSETS_BRANCH from env and MCP gateway command passthrough. |
| .github/workflows/ace-editor.lock.yml | Removes GH_AW_ASSETS_BRANCH from MCP gateway command passthrough. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Summary
Updates the
upload-assetsafe output to use the GitHub Actions Twirp artifact API (archive:false, version 7) instead of pushing to an orphaned git branch. The handler now returns a temporary asset ID that is resolved to the real artifact URL before issues/comments are created.What changed
New flow
upload_asset('/tmp/chart.png')→ receives temporary ID, e.g.aw_XYZ123upload_assetsjob uploads the file using the GitHub Actions Twirp API (archive:false) and outputsasset_url_map: {"aw_XYZ123": "https://github.com/owner/repo/actions/runs/123/artifacts/456"}safe_outputsjob (which now depends onupload_assets) replaces(aw_XYZ123)in body text with the real artifact URL before creating issues/commentsKey changes
safe_outputs_handlers.cjs– returns temporary ID instead of precomputed URL; removesGH_AW_ASSETS_BRANCHdependencyupload_assets.cjs– rewritten to use GitHub Actions Twirp API (CreateArtifact/FinalizeArtifact) instead of git push; outputsasset_url_maptemporary_id.cjs– newloadAssetUrlMap()andreplaceAssetIdReferences()for URL-position replacement of(aw_XYZ)patternscreate_issue.cjs,add_comment.cjs,create_discussion.cjs– callreplaceAssetIdReferenceson body text before publishingcompiler_safe_outputs_job.go–safe_outputsnow depends onupload_assets; receivesGH_AW_ASSET_URL_MAP; condition handles skippedupload_assets(success || skipped)publish_assets.go– removes git checkout/push steps; permissions changed fromcontents: writetoactions: write;UploadAssetsConfigstruct removesBranchNamefieldGH_AW_ASSETS_BRANCHreferences removed frommcp_environment.go,mcp_setup_generator.go,codex_engine.go,compiler_main_job.goValidation
pkg/workflow/...)