From fdd39e74dee662c2a03a12937068ed4007f6de97 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 29 Mar 2025 02:29:08 +1000 Subject: [PATCH] feat: added actions_macos field to APIMeta struct and adjusted the appropriate tests --- github/meta.go | 4 ++++ github/meta_test.go | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/github/meta.go b/github/meta.go index cc90b618b14..69235356924 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"` diff --git a/github/meta_test.go b/github/meta_test.go index 71eb2149328..ffe701f0c7c 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"},