From ba20effa07cf211b367e4ccd7356562d952267f1 Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Sat, 7 Feb 2026 20:40:30 +0200 Subject: [PATCH] Add fields `Codespaces`, `Copilot` and `ActionsInbound` to `APIMeta` Signed-off-by: Timo Sand --- github/meta.go | 15 +++++++++++++++ github/meta_test.go | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/github/meta.go b/github/meta.go index 92c4bcff6f9..6dd104c8c30 100644 --- a/github/meta.go +++ b/github/meta.go @@ -56,6 +56,14 @@ type APIMeta struct { // 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 + // GitHub Codespaces will originate from. + Codespaces []string `json:"codespaces,omitempty"` + + // An array of IP addresses in CIDR format specifying the IP addresses + // GitHub Copilot will originate from. + Copilot []string `json:"copilot,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses // Dependabot will originate from. Dependabot []string `json:"dependabot,omitempty"` @@ -86,9 +94,16 @@ type APIMetaDomains struct { Copilot []string `json:"copilot,omitempty"` Packages []string `json:"packages,omitempty"` Actions []string `json:"actions,omitempty"` + ActionsInbound *ActionsInboundDomains `json:"actions_inbound,omitempty"` ArtifactAttestations *APIMetaArtifactAttestations `json:"artifact_attestations,omitempty"` } +// ActionsInboundDomains represents the domains associated with GitHub Actions inbound traffic. +type ActionsInboundDomains struct { + FullDomains []string `json:"full_domains,omitempty"` + WildcardDomains []string `json:"wildcard_domains,omitempty"` +} + // APIMetaArtifactAttestations represents the artifact attestation services domains. type APIMetaArtifactAttestations struct { TrustDomain string `json:"trust_domain,omitempty"` diff --git a/github/meta_test.go b/github/meta_test.go index 1d9d999ea3b..4ceabe973de 100644 --- a/github/meta_test.go +++ b/github/meta_test.go @@ -76,7 +76,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"], "actions_macos": ["example.com/1", "example.com/2"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"website":["*.github.com","*.github.dev","*.github.io","*.example.com/assets","*.example.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.github.com","tuf-repo.github.com","fulcio.github.com","timestamp.github.com"]}}}`) + fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "github_enterprise_importer": ["gei"], "actions":["a"], "actions_macos": ["example.com/1", "example.com/2"], "codesapces": ["cs"], "copilot": ["c"], "dependabot":["d"], "verifiable_password_authentication": true, "domains":{"actions_inbound": { "full_domains": ["github.com"], "wildcard_domains": ["*.github.com"]},"website":["*.github.com","*.github.dev","*.github.io","*.example.com/assets","*.example.com"],"artifact_attestations":{"trust_domain":"","services":["*.actions.github.com","tuf-repo.github.com","fulcio.github.com","timestamp.github.com"]}}}`) }) ctx := t.Context() @@ -93,6 +93,8 @@ func TestMetaService_Get(t *testing.T) { GithubEnterpriseImporter: []string{"gei"}, Actions: []string{"a"}, ActionsMacos: []string{"example.com/1", "example.com/2"}, + Codespaces: []string{"cs"}, + Copilot: []string{"c"}, Dependabot: []string{"d"}, API: []string{"a"}, Web: []string{"w"}, @@ -113,6 +115,10 @@ func TestMetaService_Get(t *testing.T) { "timestamp.github.com", }, }, + ActionsInbound: &ActionsInboundDomains{ + FullDomains: []string{"github.com"}, + WildcardDomains: []string{"*.github.com"}, + }, }, VerifiablePasswordAuthentication: Ptr(true),