Repository navigation
feat: add github-enterprise-billing-report with configurable branding - #66
Merged
Merged
Conversation
Copilot CLI passes toolArgs as a JSON object rather than a string, so fromjson failed and the hook denied every bash call. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generates HTML, PDF and CSV reports of enterprise net cost by billing product over complete months, with charts, top organizations and repositories per month, enterprise-account charges, per-SKU detail and optional branding (name, logo, color, palette, CSS). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
Adds
github-enterprise-billing-report, which reports GitHub Enterprise net cost by billing product over the last complete months (the current, partial month is excluded). It writes HTML, PDF and CSV output with:BRAND_NAME,BRAND_LOGO,BRAND_COLOR,BRAND_PALETTEandBRAND_CSS, with no organization-specific styling built inAlso fixes the
block-file-writes-via-bashpreToolUse hook, which denied every bash call because Copilot CLI passestoolArgsas an object rather than a JSON string.Generated reports (
**/reports/*.htmland**/reports/*.pdf) are now gitignored because they contain billing data.Changes
reporting/github-enterprise-billing-report/github-enterprise-billing-report.shlib/github-common.shreporting/github-enterprise-billing-report/action.yml.github/hooks/scripts/block-file-writes-via-bash.shandtests/test_hooks.batstests/test_script_validation.bats(billing report section)README.md,docs/script-behaviors.md,GLOSSARY.md,.gitignoreHow to test
Expected output:
reports/billing-report-<enterprise>-<YYYY-MM>.html,.csvand (unless--no-pdf).pdf, covering the lastMONTHScomplete months (default 3).Validation run:
shellcheck --severity=warning --exclude=SC2034,SC1091 --shell=bash reporting/github-enterprise-billing-report/github-enterprise-billing-report.sh: passedbats tests/: passed (146 tests, 0 failures)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 limits (not applicable: two enterprise-level calls per month, no repo-level operations)shellcheck --severity=warning --exclude=SC2034,SC1091 --shell=bash <script>)