Skip to content

feat: add github-increase-copilot-user-budget script - #63

Merged
locus313 merged 1 commit into
mainfrom
feature/increase-copilot-user-budget
Oct 14, 2026
Merged

locus313 merged 1 commit into
mainfrom
feature/increase-copilot-user-budget

Conversation

@locus313

Copy link
Copy Markdown
Owner

Description

Adds a script to raise the Copilot AI credit budget for a single enterprise user. It shows the user's effective budget and consumption, offers +$50/+$100/+$150/+$200/+$250 presets, a custom increase, or an absolute amount, confirms, then PATCHes the user's AI credit budget or creates one when only the Universal budget applies.

Changes

  • New script: enterprise/github-increase-copilot-user-budget/github-increase-copilot-user-budget.sh (plus action.yml)
  • Modified: lib/github-common.sh
  • Other: tests/test_script_validation.bats, README.md, new GLOSSARY.md

How to test

export GITHUB_TOKEN=ghp_REDACTED
export GITHUB_ENTERPRISE=test-enterprise
./enterprise/github-increase-copilot-user-budget/github-increase-copilot-user-budget.sh -u octocat --increase 100 --dry-run

Validated with bats tests/ (all passing, including 8 new tests) and shellcheck (clean). The create and PATCH flows were exercised against a mocked curl only; not yet run against a real enterprise.

Checklist

  • set -euo pipefail is the first executable line after the # === header
  • Script sources lib/github-common.sh via SCRIPT_DIR
  • All required env vars validated with require_env_var
  • Token validated with validate_github_token (or validate_token for secondary tokens)
  • User-supplied slugs validated with validate_slug
  • sleep added between repo-level operations to respect rate limits (n/a: single-user operation)
  • README.md updated with the new/changed script (env var table + usage example)
  • Script header comment matches README documentation
  • Tested on a non-production org before production
  • shellcheck passes (shellcheck --severity=warning --exclude=SC2034,SC1091 --shell=bash <script>)

Lets an enterprise admin raise a single user's Copilot AI credit budget
interactively (preset, custom, or absolute amount) or non-interactively,
creating a user budget when only the Universal budget applies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@locus313
locus313 merged commit 5c07c2e into main Oct 14, 2026
2 checks passed
@locus313
locus313 deleted the feature/increase-copilot-user-budget branch October 14, 2026 19:22
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.

1 participant