This repository includes a Bash script that sets enterprise billing budgets for users using the GitHub CLI.
Put one username per line:
emu_user1_ecanarys
emu_user2_ecanarys
emu_user3_ecanarys
emu_user4_ecanarys
Save your script as:
set_budgets.shMake it executable:
chmod +x set_budgets.shexport ENTERPRISE="your-enterprise-slug"
export API_VERSION="2022-11-28"gh auth refresh -h github.com -s manage_billing:enterpriseUpdate the amount in set_budgets.sh before running:
BUDGET_AMOUNT=10.00./set_budgets.sh users.csv[1] Processing user: emu_user1_ecanarys ... SUCCESS
[2] Processing user: emu_user2_ecanarys ... SUCCESS
[3] Processing user: emu_user3_ecanarys ... SKIPPED (already exists)
======================================
Total Processed: 3
Successful: 3
Failed: 0
======================================
emu_user1_ecanarys
emu_user2_ecanarys
emu_user3_ecanarys
- The script skips empty lines and lines starting with
#. - Ensure your GitHub account has enterprise billing permissions.
- If you see "Not Found", verify the
ENTERPRISEslug is correct.