-
Notifications
You must be signed in to change notification settings - Fork 330
upload-asset safe output doesn't work for private repos #22510
Description
Problem
The upload-asset safe output pushes image files to an orphan branch (e.g., assets/Weekly-Team-Report) and returns raw.githubusercontent.com URLs. These URLs return 404 for private repositories because raw.githubusercontent.com requires authentication for private repo content.
When these URLs are embedded in GitHub Discussions (or Issues), GitHub's markdown renderer does not proxy them — the images appear broken.
Current Behavior
- Agent generates chart images and calls
upload_assettool - Safe output handler pushes PNGs to orphan branch
assets/<workflow-name> - Returns URL:
https://raw.githubusercontent.com/<owner>/<repo>/assets/<workflow-name>/<hash>.png - URL works for public repos ✅
- URL returns 404 for private repos ❌
- Images embedded in Discussions/Issues show as broken ❌
Expected Behavior
upload-asset should return URLs that work for authenticated GitHub users viewing Discussions/Issues in private repos.
Reproduction
- Create a workflow with
upload-assetsafe output in a private repo - Generate and upload an image
- Embed the returned URL in a
create-discussionsafe output - View the discussion — images are broken (404)
Suggested Fix
Use GitHub's image upload/attachment service (the same one used by drag-and-drop image uploads in Issues/Discussions) instead of pushing to an orphan branch. This produces user-attachments URLs that work for any authenticated user with repo access, regardless of repo visibility.
Alternatively, use the GitHub API to create blob URLs (/repos/{owner}/{repo}/git/blobs) which can be accessed by authenticated users.
Workaround
For now, skip upload_asset and save charts as workflow artifacts (data-charts artifact) that users can download from the Actions tab.