Skip to content

ci: emit the api-calls notice from report-api-budget #905

Closed

Description

@kyle-sexton

Problem

The report-api-budget composite (.github/actions/report-api-budget) writes only the api-budget notice. It writes no api-calls notice, so the GITHUB_TOKEN requests of every job that ends with it (for example the review jobs in .github/workflows/pr-review-cli.yml) never reach the hub's per-job call count. In melodic-software/claude-code-plugins, the per-job api-calls github-token=N notices account for only part of the spend that GITHUB_TOKEN's rate-limit headers show (melodic-software/standards#899 measured 932 of 3,804 calls logged in one hour). Its api-budget.bash has api_budget_read and api_budget_emit and no api_budget_emit_calls.

Fix

Port the consumer's api_budget_emit_calls and its api-calls step lines from melodic-software/claude-code-plugins .github/actions/log-api-budget (api-budget.bash and action.yml). The notice is ::notice title=api-calls::<token>=N not-modified=M: N counts the job's own requests, M its 304 answers (which GitHub does not count), and a token with no reading gets <token>=0 not-modified=0. Then have report-api-budget emit it for each named token, after the api-budget notice. This follows the same pattern as melodic-software/standards#899.

If the composite's callers also run gh commands that are not gh api -i (paginated reads, gh pr ...), they are uncounted the same way the consumer's were. melodic-software/claude-code-plugins counts those by running gh with GH_DEBUG=1 and counting its * Request to <url> lines (see Related).

Acceptance

  • Each job that uses report-api-budget writes one api-calls github-token=N not-modified=M notice, at 0 when it has no reading.
  • No changes to permissions, secrets or triggers.

Related

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 28, 2026
  2. kyle-sexton commented on Nov 8, 2026

    @kyle-sexton
    MemberAuthor

    Fixed on main by #942 (b078cd0): report-api-budget writes ::notice title=api-calls::<token>=N not-modified=M graphql=K per token (.github/actions/report-api-budget/api-budget.bash:138), and pr-review-cli jobs already end with that step. #915 is closed as redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageNot yet classified. Floor until a type and one priority tier are set.

    Type

    No type

    Fields

    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