Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/aw/charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,14 @@ steps:
retention-days: 30

safe-outputs:
upload-artifact:
max-uploads: 3
retention-days: 30
skip-archive: true
upload-asset:
allowed-exts:
- ".png"
- ".jpg"
- ".svg"
```

### Agent Instructions

Libraries: NumPy, Pandas, Matplotlib, Seaborn, SciPy
Directories: `/tmp/gh-aw/python/{data,charts,artifacts}`, `/tmp/gh-aw/cache-memory/`

**Store Historical Data (JSON Lines)**:
Expand Down Expand Up @@ -145,10 +144,11 @@ network:
- python

safe-outputs:
upload-artifact:
max-uploads: 3
retention-days: 30
skip-archive: true
upload-asset:
allowed-exts:
- ".png"
- ".jpg"
- ".svg"

steps:
- name: Setup Python environment
Expand Down Expand Up @@ -318,10 +318,11 @@ tools:
key: charts-trending-${{ github.workflow }}-${{ github.run_id }}

safe-outputs:
upload-artifact:
max-uploads: 3
retention-days: 30
skip-archive: true
upload-asset:
allowed-exts:
- ".png"
- ".jpg"
- ".svg"
```

### Agent Instructions
Expand Down
184 changes: 145 additions & 39 deletions .github/workflows/api-consumption-report.lock.yml

Large diffs are not rendered by default.

52 changes: 19 additions & 33 deletions .github/workflows/api-consumption-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ engine: claude
tools:
agentic-workflows:
timeout: 300
safe-outputs:
upload-artifact:
max-uploads: 5
retention-days: 30
skip-archive: true
timeout-minutes: 45
imports:
- uses: shared/daily-audit-discussion.md
Expand Down Expand Up @@ -299,40 +294,31 @@ Use `sns.set_theme(style="darkgrid")` for a professional dark-grid look and `plt

---

## Step 5 — Upload Charts as Artifacts
## Step 5 — Upload Charts as Assets

**You MUST copy the chart files to the staging directory before calling `upload_artifact`.**
Call `upload_asset` once per chart (5 total). The tool returns the permanent image URL directly — collect each URL to embed in the discussion.

The `upload_artifact` tool only reads files from `$RUNNER_TEMP/gh-aw/safeoutputs/upload-artifacts/`. Run these commands first:

```bash
mkdir -p "$RUNNER_TEMP/gh-aw/safeoutputs/upload-artifacts/"
cp /tmp/gh-aw/python/charts/*.png "$RUNNER_TEMP/gh-aw/safeoutputs/upload-artifacts/"
```
| Chart file | Variable to store URL |
|---|---|
| `api_calls_trend.png` | `URL_api_trend` |
| `workflow_api_trend.png` | `URL_wf_trend` |
| `api_heatmap.png` | `URL_heatmap` |
| `api_burners_donut.png` | `URL_donut` |
| `api_by_workflow.png` | `URL_by_wf` |

Then verify the files are in the staging directory:
Example call:

```bash
ls -la "$RUNNER_TEMP/gh-aw/safeoutputs/upload-artifacts/"
```json
{ "type": "upload_asset", "path": "/tmp/gh-aw/python/charts/api_calls_trend.png" }
```

After confirming the files exist in the staging directory, call `upload_artifact` for each chart using the **filename only** (not a subdirectory path). For example, use `path: "api_calls_trend.png"` — NOT `path: "charts/api_calls_trend.png"`.

Call `upload_artifact` once per chart (5 total), specifying the `temporary_id` for each so the chart can be embedded as an inline image in the discussion:

| 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` |
The tool returns the URL (e.g. `https://github.com/…/blob/assets/…?raw=true`). Store each returned URL for use in the discussion body below.

---

## Step 6 — Create Daily Discussion

Create a discussion with the following structure. Replace placeholders with real values.
Create a discussion with the following structure. Replace placeholders with real values, and substitute each `URL_*` with the actual URL returned by `upload_asset` in Step 5.

**Category**: `audits`

Expand Down Expand Up @@ -361,39 +347,39 @@ Create a discussion with the following structure. Replace placeholders with real

### 🔗 GitHub API Calls Trend (90 days)

![GitHub API Calls Trend](#aw_api_trend)
![GitHub API Calls Trend](URL_api_trend)

{2–3 sentences: highlight the trend direction, peak days, and any notable spikes in total REST API consumption}

---

### 🔗 GitHub API Calls by Workflow Trend (30 days)

![GitHub API Calls by Workflow Trend](#aw_wf_trend)
![GitHub API Calls by Workflow Trend](URL_wf_trend)

{2–3 sentences: note which workflows consistently consume the most API quota and any emerging patterns over the last 30 days}

---

### 🔗 GitHub REST API Calls Heatmap (90 days)

![GitHub REST API Calls Heatmap](#aw_heatmap)
![GitHub REST API Calls Heatmap](URL_heatmap)

{2–3 sentences: describe weekly patterns, busiest days, and any anomalies in REST API consumption}

---

### 🍩 Top API Burners (24h)

![Top API Burners](#aw_donut)
![Top API Burners](URL_donut)

{2–3 sentences: describe which workflows dominate API consumption, their share of the total, and any concentration risk}

---

### 🔗 GitHub REST API Consumption by Workflow (last 24h)

![GitHub REST API Consumption by Workflow](#aw_by_wf)
![GitHub REST API Consumption by Workflow](URL_by_wf)

{2–3 sentences: identify the top REST API consumers, note any workflows near the 15k/hr limit, and suggest optimisation opportunities}

Expand Down
Loading