fix: use upload_asset instead of upload_artifact for chart image embedding in discussions#26269
Closed
fix: use upload_asset instead of upload_artifact for chart image embedding in discussions#26269
Conversation
…dding in discussions Fixes broken image links in discussions (e.g. #26211). upload_artifact URLs require GitHub authentication (redirect to Azure Blob Storage via an auth flow). GitHub's image proxy (Camo) cannot authenticate, so images embedded as  in discussions always appear broken. upload_asset pushes files to a permanent git branch and returns https://github.com/repo/blob/branch/{sha}?raw=true URLs that render correctly as inline images and never expire. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/eed4c740-ea5e-4d55-865e-7daa25ffeea9 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
April 14, 2026 18:05
View session
This was referenced Apr 14, 2026
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 broken image links in GitHub discussions (e.g. #26211).
Root Cause
Workflows like
api-consumption-report.mdwere usingupload_artifactwithtemporary_idto upload chart images, then embedding them in discussions as. After the safe-output manager resolved the temporary IDs, discussions ended up with:These artifact URLs require GitHub authentication — they redirect through an authenticated flow to Azure Blob Storage. GitHub's image proxy (Camo) cannot authenticate this redirect, so
<img>tags using artifact URLs always load broken.Fix
Replace
upload-artifactsafe-output configuration (used for image embedding) withupload-assetin the shared workflow components. Theupload_assettool:https://github.com/repo/blob/assets/…?raw=true?raw=trueURL renders as an inline image for authenticated GitHub usersThe agent now receives the URL directly and embeds it literally, rather than using a
#aw_temporary_idplaceholder that gets swapped in later.Changes
shared/trending-charts-simple.mdupload-artifactsafe-output withupload-asset; update agent instructionsshared/python-dataviz.mdapi-consumption-report.mdupload-artifactconfig (shared import providesupload-asset); rewrite Step 5 to useupload_assetand Step 6 to use direct URLs instead of#aw_*placeholders.github/aw/charts.mdupload-assetconfiguration*.lock.ymlupload_assetsjob withcontents: write