Feature/copilot report ai credit budgets - #53
Merged
Conversation
added 2 commits
August 4, 2026 08:48
Reports each licensed user's effective Universal/Individual AI credit
budget and consumption via the enterprise-level Budgets API
(GET /enterprises/{enterprise}/settings/billing/budgets and
.../budgets/{id}/user-states), adding Budget Scope/Limit/Used/Remaining
CSV columns. Adds a --no-budgets flag to skip the lookup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for reporting and optionally skipping per-user AI credit budgets (Universal and Individual) in the GitHub Copilot enterprise usage report. The script now fetches and displays each user's effective AI credit budget and their consumption, and introduces a
--no-budgetsoption to disable this lookup if desired. Documentation, the GitHub Action, and tests have been updated accordingly.Major feature: Per-user AI credit budgets
--no-budgetsoption to skip budget lookups, with appropriate handling and messaging if the user lacks permissions or budgets are not configured. [1] [2] [3] [4] [5] [6] [7]Documentation updates
README.mdand script comments are updated to describe the new budget reporting features and the new--no-budgetsoption, including requirements and expected output. [1] [2] [3] [4]Output changes
Budget Scope,Budget Limit (USD),Budget Used (USD), andBudget Remaining (USD)for each user.Test coverage
--no-budgetsoption is recognized and handled by the script.## DescriptionChanges
<domain>/github-<name>/github-<name>.shlib/github-common.shHow to test
Checklist
set -euo pipefailis the first executable line after the# ===headerlib/github-common.shviaSCRIPT_DIRrequire_env_varvalidate_github_token(orvalidate_tokenfor secondary tokens)validate_slugsleepadded between repo-level operations to respect rate limitsshellcheck --severity=warning --exclude=SC2034,SC1091 --shell=bash <script>)