Repository: google/go-github
Pull request #3535 (2025-03-28 17:07:29)

feat: Add actions_macos field to APIMeta struct
added ActionsMacOs to APIMeta struct for https://github.com/google/go-github/issues/3534 

Fixes: #3534. 

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/3535?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 91.31%. Comparing base [(`4f05dfb`)](https://app.codecov.io/gh/google/go-github/commit/4f05dfb48f5ef0ce3d26e106d50c3e65b120c9b9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) to head [(`41298d1`)](https://app.codecov.io/gh/google/go-github/commit/41298d1cf41158783e76b3ca130f5c50bcab2a11?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           master    #3535   +/-   ##
=======================================
  Coverage   91.31%   91.31%           
=======================================
  Files         184      184           
  Lines       16169    16169           
=======================================
  Hits        14765    14765           
  Misses       1230     1230           
  Partials      174      174           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/google/go-github/pull/3535?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
CameronBadman: @gmlewis Resolved the naming issues.

Patch:
diff --git a/github/meta.go b/github/meta.go
index cc90b618..69235356 100644
--- a/github/meta.go
+++ b/github/meta.go
@@ -52,6 +52,10 @@ type APIMeta struct {
 	// GitHub Actions will originate from.
 	Actions []string `json:"actions,omitempty"`
 
+	// An array of IP addresses in CIDR format specifying the IP addresses
+	// GitHub Action macOS runner will originate from.
+	ActionsMacos []string `json:"actions_macos,omitempty"`
+
 	// An array of IP addresses in CIDR format specifying the IP addresses
 	// Dependabot will originate from.
 	Dependabot []string `json:"dependabot,omitempty"`


Test patch:
diff --git a/github/meta_test.go b/github/meta_test.go
index 71eb2149..ffe701f0 100644
--- a/github/meta_test.go
+++ b/github/meta_test.go
@@ -26,6 +26,7 @@ func TestAPIMeta_Marshal(t *testing.T) {
 		Importer:                         []string{"i"},
 		GithubEnterpriseImporter:         []string{"gei"},
 		Actions:                          []string{"a"},
+		ActionsMacos:                     []string{"192.0.2.1/32", "198.51.100.0/24"},
 		Dependabot:                       []string{"d"},
 		SSHKeyFingerprints:               map[string]string{"a": "f"},
 		SSHKeys:                          []string{"k"},
@@ -58,6 +59,7 @@ func TestAPIMeta_Marshal(t *testing.T) {
 		"importer":["i"],
 		"github_enterprise_importer":["gei"],
 		"actions":["a"],
+    "actions_macos":["192.0.2.1/32", "198.51.100.0/24"],
 		"dependabot":["d"],
 		"ssh_key_fingerprints":{"a":"f"},
 		"ssh_keys":["k"],
@@ -75,7 +77,7 @@ func TestMetaService_Get(t *testing.T) {
 
 	mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, "GET")
-		fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"website":["*.github.com","*.github.dev","*.github.io","*.githubassets.com","*.githubusercontent.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.githubusercontent.com","tuf-repo.github.com","fulcio.githubapp.com","timestamp.githubapp.com"]}}}`)
+		fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "actions_macos": ["192.0.2.1/32", "198.51.100.0/24"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"website":["*.github.com","*.github.dev","*.github.io","*.githubassets.com","*.githubusercontent.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.githubusercontent.com","tuf-repo.github.com","fulcio.githubapp.com","timestamp.githubapp.com"]}}}`)
 	})
 
 	ctx := context.Background()
@@ -91,6 +93,7 @@ func TestMetaService_Get(t *testing.T) {
 		Importer:                 []string{"i"},
 		GithubEnterpriseImporter: []string{"gei"},
 		Actions:                  []string{"a"},
+		ActionsMacos:             []string{"192.0.2.1/32", "198.51.100.0/24"},
 		Dependabot:               []string{"d"},
 		API:                      []string{"a"},
 		Web:                      []string{"w"},