Skip to content

Commit 36c47d1

Browse files
authored
Change total_minutes_used and included_minutes from int to float64 (#2643)
Fixes: #2642.
1 parent 2561c07 commit 36c47d1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

github/billing.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ type BillingService service
1818

1919
// ActionBilling represents a GitHub Action billing.
2020
type ActionBilling struct {
21-
TotalMinutesUsed int `json:"total_minutes_used"`
21+
TotalMinutesUsed float64 `json:"total_minutes_used"`
2222
TotalPaidMinutesUsed float64 `json:"total_paid_minutes_used"`
23-
IncludedMinutes int `json:"included_minutes"`
23+
IncludedMinutes float64 `json:"included_minutes"`
2424
MinutesUsedBreakdown MinutesUsedBreakdown `json:"minutes_used_breakdown"`
2525
}
2626

@@ -29,16 +29,16 @@ type MinutesUsedBreakdown = map[string]int
2929

3030
// PackageBilling represents a GitHub Package billing.
3131
type PackageBilling struct {
32-
TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"`
33-
TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"`
34-
IncludedGigabytesBandwidth int `json:"included_gigabytes_bandwidth"`
32+
TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"`
33+
TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"`
34+
IncludedGigabytesBandwidth float64 `json:"included_gigabytes_bandwidth"`
3535
}
3636

3737
// StorageBilling represents a GitHub Storage billing.
3838
type StorageBilling struct {
3939
DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"`
4040
EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"`
41-
EstimatedStorageForMonth int `json:"estimated_storage_for_month"`
41+
EstimatedStorageForMonth float64 `json:"estimated_storage_for_month"`
4242
}
4343

4444
// ActiveCommitters represents the total active committers across all repositories in an Organization.

github/billing_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) {
2121
mux.HandleFunc("/orgs/o/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) {
2222
testMethod(t, r, "GET")
2323
fmt.Fprint(w, `{
24-
"total_minutes_used": 305,
24+
"total_minutes_used": 305.0,
2525
"total_paid_minutes_used": 0.0,
26-
"included_minutes": 3000,
26+
"included_minutes": 3000.0,
2727
"minutes_used_breakdown": {
2828
"UBUNTU": 205,
2929
"MACOS": 10,
@@ -39,9 +39,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) {
3939
}
4040

4141
want := &ActionBilling{
42-
TotalMinutesUsed: 305,
43-
TotalPaidMinutesUsed: 0,
44-
IncludedMinutes: 3000,
42+
TotalMinutesUsed: 305.0,
43+
TotalPaidMinutesUsed: 0.0,
44+
IncludedMinutes: 3000.0,
4545
MinutesUsedBreakdown: MinutesUsedBreakdown{
4646
"UBUNTU": 205,
4747
"MACOS": 10,

0 commit comments

Comments
 (0)