You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(scripts): BSD head portability and restore billing and Entra ID features (#23)
* fix(lib): replace head -n -1 with sed $'d' for BSD head portability
GNU head supports negative line counts (head -n -1 = all but last line)
but BSD head on macOS does not, producing 'illegal line count' errors.
Replace with sed '$d' which deletes the last line portably on both
BSD and GNU sed.
Affected: gh_api and _graphql_enterprise_orgs in lib/github-common.sh.
* fix(copilot-report): restore billing and Entra ID after dual-auth refactor
Three regressions introduced by the d45fe33 dual-auth refactor are fixed:
Billing API (credits used per user):
- _copilot_api used head -n -1 which fails on macOS BSD head; now uses
sed '$d' (fixed at lib level, copied to _copilot_api in this script).
- HTTP 404 and 422 responses from the billing endpoint are valid —
they mean no usage data this month — treat them as 0 credits instead
of marking the user as a failure.
- Remove _billing_api() gh-CLI wrapper: now that lib syncs GH_TOKEN
from GITHUB_TOKEN automatically, both curl and gh api use the same
token, so the wrapper adds complexity without benefit.
Entra ID department enrichment:
- Auto-resolve the Azure AD tenant GUID from UPN_DOMAIN via OIDC
discovery (GET login.microsoftonline.com/{domain}/.well-known/
openid-configuration) so --entra-tenant is rarely needed.
- Switch graph_user_info from az rest to curl with the explicit
GRAPH_TOKEN so the correct tenant's token is always used.
- Add --entra-tenant flag and $ENTRA_TENANT env var as an override
when OIDC discovery resolves to the wrong tenant.
action.yml: update entra-tenant description to reflect auto-resolution.
---------
Co-authored-by: Patrick Lewis <plewis@ontinue.com>
Copy file name to clipboardExpand all lines: reporting/github-copilot-report/action.yml
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,10 @@ inputs:
11
11
description: 'Email domain for Entra ID lookup when GitHub carries no email address (e.g. example.com)'
12
12
required: false
13
13
default: ''
14
+
entra-tenant:
15
+
description: 'Override the Azure AD tenant ID for the Graph API lookup. Auto-resolved from upn-domain via OIDC discovery; only needed when that result is incorrect.'
16
+
required: false
17
+
default: ''
14
18
credits:
15
19
description: 'Override credits-per-seat value if your portal shows a different pool size'
0 commit comments