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
Browse filesBrowse the repository at this point in the historyBrowse files
Patrick Lewis
committed
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.
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