Skip to content

Add on-demand token audit workflow with date-range dispatch input#36412

Merged
mnkiefer merged 11 commits into
mainfrom
copilot/create-github-agentic-workflow
Jun 2, 2026
Merged

Add on-demand token audit workflow with date-range dispatch input#36412
mnkiefer merged 11 commits into
mainfrom
copilot/create-github-agentic-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 2, 2026

This change introduces an on-demand variant of the Agentic Token Audit that runs via workflow_dispatch and accepts a caller-provided date range for analysis.

  • Scope of change

    • Added a new workflow: .github/workflows/agentic-token-trend-audit.md
    • Added compiled lock file: .github/workflows/agentic-token-trend-audit.lock.yml
  • Trigger and input model

    • Removed scheduled execution; workflow is now manual-only.
    • Added required workflow_dispatch input:
      • date_range (default: -30d..-0d)
      • Expected format: <start>..<end> (e.g., 2026-05-01..2026-05-31)
  • Date-range log collection

    • Updated log download step to parse and validate date_range.
    • Switched from fixed --start-date -1d to dynamic:
      • --start-date "$START_DATE"
      • --end-date "$END_DATE"
    • Increased run fetch cap to improve larger-window coverage.
DATE_RANGE="$DATE_RANGE_INPUT"
START_DATE="${DATE_RANGE%%..*}"
END_DATE="${DATE_RANGE##*..}"

gh aw logs \
  --start-date "$START_DATE" \
  --end-date "$END_DATE" \
  --json \
  -c 500 \
  > /tmp/gh-aw/token-audit/workflow-logs.json
  • Report/prompt alignment
    • Reframed workflow instructions to be one-off and range-focused.
    • Removed repo-memory persistence and rolling-summary update behavior for this workflow.
    • Reduced chart requirements to token usage by workflow for the requested range.

Copilot AI and others added 4 commits June 2, 2026 05:30
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer
Copy link
Copy Markdown
Collaborator

mnkiefer commented Jun 2, 2026

@copilot Revert changes to agentic-token-audit.lock.yml and agentic-token-optimzier.lock.yml files.

Copilot AI and others added 2 commits June 2, 2026 06:50
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 2, 2026

@copilot Revert changes to agentic-token-audit.lock.yml and agentic-token-optimzier.lock.yml files.

Fixed in commit 73421d4: both .github/workflows/agentic-token-audit.lock.yml and .github/workflows/agentic-token-optimizer.lock.yml were reverted to their pre-change state.

Copilot AI requested a review from mnkiefer June 2, 2026 06:57
@mnkiefer mnkiefer marked this pull request as ready for review June 2, 2026 06:58
Copilot AI review requested due to automatic review settings June 2, 2026 06:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new on-demand “Agentic Workflow Token Trend Audit” workflow that can be manually dispatched with a caller-provided date range, downloads gh aw logs JSON for that window, and prompts an agent to persist snapshots, generate charts, and publish an issue emphasizing the historical token trend.

Changes:

  • Introduces .github/workflows/agentic-token-trend-audit.md with workflow_dispatch input date_range and dynamic --start-date/--end-date log collection.
  • Adds instructions to persist snapshot + rolling summary, generate token charts, and publish an audit issue focused on the trend chart.
  • Commits the compiled workflow lock file .github/workflows/agentic-token-trend-audit.lock.yml.
Show a summary per file
File Description
.github/workflows/agentic-token-trend-audit.md New on-demand token trend audit workflow definition, including date-range input parsing and agent instructions for snapshots/charts/issue publication.
.github/workflows/agentic-token-trend-audit.lock.yml Compiled lockfile for the new workflow (runtime-executed GitHub Actions YAML).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/2 changed files
  • Comments generated: 4

Comment thread .github/workflows/agentic-token-trend-audit.md Outdated
Comment thread .github/workflows/agentic-token-trend-audit.md
Comment thread .github/workflows/agentic-token-trend-audit.md Outdated
Comment thread .github/workflows/agentic-token-trend-audit.lock.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

@copilot fix the failing test check and rerun CI.

Generated by 👨‍🍳 PR Sous Chef · gpt54 1.8M ·

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer
Copy link
Copy Markdown
Collaborator

mnkiefer commented Jun 2, 2026

@copilot Recompile workflows

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 2, 2026

@copilot Revert changes to agentic-token-audit.lock.yml and agentic-token-optimzier.lock.yml files.

Done in 08bb61f.

@copilot Recompile workflows

Done in 08bb61f.

Copilot AI changed the title Add on-demand token trend audit workflow with date-range dispatch input Add on-demand token audit workflow with date-range dispatch input Jun 2, 2026
@mnkiefer mnkiefer merged commit 04175d0 into main Jun 2, 2026
@mnkiefer mnkiefer deleted the copilot/create-github-agentic-workflow branch June 2, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants