Skip to content

[q] feat(api-consumption-report): render charts as inline markdown imagesΒ #26149

@github-actions

Description

@github-actions

Fixes the chart display in the daily API consumption report discussion (see discussion #26107).

What changed

Problem: Charts were embedded as plain artifact download links:

πŸ“Ž **[Chart: GitHub API Calls Trend](...)** β€” artifact `{api_calls_trend_aw_id}`

These require the reader to navigate to the Actions run and manually download the PNG files.

Fix: Use upload_artifact with a temporary_id and the #aw_ID substitution syntax, so each chart renders as a real inline markdown image:

![GitHub API Calls Trend](#aw_api_trend)

The safe-outputs processor replaces #aw_api_trend with the actual artifact download URL. Because skip-archive: true is already configured in the workflow frontmatter, the URL points directly to the PNG file and is suitable for inline images.

Changes

.github/workflows/api-consumption-report.md

Step 5 β€” each upload_artifact call now specifies a temporary_id:

Chart file temporary_id
api_calls_trend.png aw_api_trend
workflow_api_trend.png aw_wf_trend
api_heatmap.png aw_heatmap
api_burners_donut.png aw_donut
api_by_workflow.png aw_by_wf

Step 6 β€” chart sections in the discussion body template now use ![alt](#aw_ID) instead of the πŸ“Ž **[Chart: ...]** β€” artifact ... link format.

Validation

  • βœ… api-consumption-report compiled successfully (no errors, no warnings)

References


Warning

Protected Files β€” Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.

Protected files

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.

Create the pull request manually
# Download the patch from the workflow run
gh run download 24379748264 -n agent -D /tmp/agent-24379748264

# Create a new branch
git checkout -b q/render-charts-as-markdown-images-180bd64b539b7282 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-24379748264/aw-q-render-charts-as-markdown-images.patch

# Push the branch and create the pull request
git push origin q/render-charts-as-markdown-images-180bd64b539b7282
gh pr create --title '[q] feat(api-consumption-report): render charts as inline markdown images' --base main --head q/render-charts-as-markdown-images-180bd64b539b7282 --repo github/gh-aw

🎩 Equipped by Q Β· ● 1.1M Β· β—·

  • expires on Apr 16, 2026, 3:47 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions