Repository: google/go-github
Pull request #2643 (2023-01-25 11:55:30)

Change total_minutes_used and included_minutes from int to float64
Fixes https://github.com/google/go-github/issues/2642

GitHub Actions returns total_minutes_used and included_minutes as floating point value.
The Implementation should accept this floating point value as float64.

Example

```
curl -H "Authorization: Bearer <TOKEN>" \
-H "Accept: application/vnd.github.v3+json"  \
https://api.github.com/orgs/{org}/settings/billing/actions
```

```json
{
  "total_minutes_used": 1234.0,
  "total_paid_minutes_used": 3959.0,
  "included_minutes": 3000.0,
  "minutes_used_breakdown": {
    "UBUNTU": 1234,
    "MACOS": 1234,
    "WINDOWS": 0
  }
}
```

codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/2643?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2643](https://codecov.io/gh/google/go-github/pull/2643?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (d7947b8) into [master](https://codecov.io/gh/google/go-github/commit/2561c07393f1a665976919fe051d7f2e0cc660b4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (2561c07) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master    #2643   +/-   ##
=======================================
  Coverage   98.05%   98.05%           
=======================================
  Files         130      130           
  Lines       11242    11242           
=======================================
  Hits        11023    11023           
  Misses        150      150           
  Partials       69       69           
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/2643?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/billing.go](https://codecov.io/gh/google/go-github/pull/2643?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2JpbGxpbmcuZ28=) | `100.00% <ø> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

gmlewis: Thank you, @valbeat !
Merging.

Patch:
diff --git a/github/billing.go b/github/billing.go
index 2f5861ce..2900a016 100644
--- a/github/billing.go
+++ b/github/billing.go
@@ -18,9 +18,9 @@ type BillingService service
 
 // ActionBilling represents a GitHub Action billing.
 type ActionBilling struct {
-	TotalMinutesUsed     int                  `json:"total_minutes_used"`
+	TotalMinutesUsed     float64              `json:"total_minutes_used"`
 	TotalPaidMinutesUsed float64              `json:"total_paid_minutes_used"`
-	IncludedMinutes      int                  `json:"included_minutes"`
+	IncludedMinutes      float64              `json:"included_minutes"`
 	MinutesUsedBreakdown MinutesUsedBreakdown `json:"minutes_used_breakdown"`
 }
 
@@ -29,16 +29,16 @@ type MinutesUsedBreakdown = map[string]int
 
 // PackageBilling represents a GitHub Package billing.
 type PackageBilling struct {
-	TotalGigabytesBandwidthUsed     int `json:"total_gigabytes_bandwidth_used"`
-	TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"`
-	IncludedGigabytesBandwidth      int `json:"included_gigabytes_bandwidth"`
+	TotalGigabytesBandwidthUsed     int     `json:"total_gigabytes_bandwidth_used"`
+	TotalPaidGigabytesBandwidthUsed int     `json:"total_paid_gigabytes_bandwidth_used"`
+	IncludedGigabytesBandwidth      float64 `json:"included_gigabytes_bandwidth"`
 }
 
 // StorageBilling represents a GitHub Storage billing.
 type StorageBilling struct {
 	DaysLeftInBillingCycle       int     `json:"days_left_in_billing_cycle"`
 	EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"`
-	EstimatedStorageForMonth     int     `json:"estimated_storage_for_month"`
+	EstimatedStorageForMonth     float64 `json:"estimated_storage_for_month"`
 }
 
 // ActiveCommitters represents the total active committers across all repositories in an Organization.


Test patch:
diff --git a/github/billing_test.go b/github/billing_test.go
index 6a85cd22..52b338b8 100644
--- a/github/billing_test.go
+++ b/github/billing_test.go
@@ -21,9 +21,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) {
 	mux.HandleFunc("/orgs/o/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, "GET")
 		fmt.Fprint(w, `{
-				"total_minutes_used": 305,
+				"total_minutes_used": 305.0,
 				"total_paid_minutes_used": 0.0,
-				"included_minutes": 3000,
+				"included_minutes": 3000.0,
 				"minutes_used_breakdown": {
 					"UBUNTU": 205,
 					"MACOS": 10,
@@ -39,9 +39,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) {
 	}
 
 	want := &ActionBilling{
-		TotalMinutesUsed:     305,
-		TotalPaidMinutesUsed: 0,
-		IncludedMinutes:      3000,
+		TotalMinutesUsed:     305.0,
+		TotalPaidMinutesUsed: 0.0,
+		IncludedMinutes:      3000.0,
 		MinutesUsedBreakdown: MinutesUsedBreakdown{
 			"UBUNTU":  205,
 			"MACOS":   10,