From 932a0eeb48870c28fc2b7d88bb19d42e71d3cc56 Mon Sep 17 00:00:00 2001 From: Stephanie Swaney Date: Sat, 25 Jul 2026 16:30:48 -0700 Subject: [PATCH 1/5] feat: Support OIDC custom property claims for Actions --- github/actions_oidc.go | 113 +++++++++++++++++ github/actions_oidc_test.go | 214 ++++++++++++++++++++++++++++++++ github/github-accessors.go | 16 +++ github/github-accessors_test.go | 19 +++ 4 files changed, 362 insertions(+) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index 504a1a9b44c..63fddff0111 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -81,3 +81,116 @@ func (s *ActionsService) setOIDCSubjectClaimCustomTemplate(ctx context.Context, return s.client.Do(req, nil) } + +// InclusionSource represents whether the custom oidc property claim was defined at the organization or enterprise level. +type InclusionSource string + +// InclusionSource constants represent whether the inclusion was defined at the organization or enterprise level. +const ( + InclusionSourceEnterprise InclusionSource = "enterprise" + InclusionSourceOrganization InclusionSource = "organization" +) + +// OIDCCustomPropertyClaim represents an OIDC custom property claim for GitHub Actions. +type OIDCCustomPropertyClaim struct { + CustomPropertyName *string `json:"custom_property_name,omitempty"` + InclusionSource *InclusionSource `json:"inclusion_source,omitempty"` +} + +// ListEnterpriseOIDCCustomPropertyClaims lists the custom property claims in oidc for enterprise actions. +// +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#list-oidc-custom-property-inclusions-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/oidc/customization/properties/repo +func (s *ActionsService) ListEnterpriseOIDCCustomPropertyClaims(ctx context.Context, enterprise string) ([]*OIDCCustomPropertyClaim, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/oidc/customization/properties/repo", enterprise) + return s.listOIDCCustomPropertyClaims(ctx, u) +} + +// ListOrgOIDCCustomPropertyClaims lists the custom property claims in oidc for organization actions. +// +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#list-oidc-custom-property-inclusions-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/oidc/customization/properties/repo +func (s *ActionsService) ListOrgOIDCCustomPropertyClaims(ctx context.Context, org string) ([]*OIDCCustomPropertyClaim, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/oidc/customization/properties/repo", org) + return s.listOIDCCustomPropertyClaims(ctx, u) +} + +func (s *ActionsService) listOIDCCustomPropertyClaims(ctx context.Context, url string) ([]*OIDCCustomPropertyClaim, *Response, error) { + req, err := s.client.NewRequest(ctx, "GET", url, nil) + if err != nil { + return nil, nil, err + } + + var props []*OIDCCustomPropertyClaim + resp, err := s.client.Do(req, &props) + if err != nil { + return nil, resp, err + } + + return props, resp, nil +} + +// SetEnterpriseOIDCCustomPropertyClaim sets a new custom property claim in oidc for enterprise actions. +// +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#create-an-oidc-custom-property-inclusion-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/oidc/customization/properties/repo +func (s *ActionsService) SetEnterpriseOIDCCustomPropertyClaim(ctx context.Context, enterprise string, body OIDCCustomPropertyClaim) (*OIDCCustomPropertyClaim, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/oidc/customization/properties/repo", enterprise) + return s.setOIDCCustomPropertyClaim(ctx, u, body) +} + +// SetOrgOIDCCustomPropertyClaim sets a new custom property claim in oidc for organization actions. +// +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#create-an-oidc-custom-property-inclusion-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/oidc/customization/properties/repo +func (s *ActionsService) SetOrgOIDCCustomPropertyClaim(ctx context.Context, org string, body OIDCCustomPropertyClaim) (*OIDCCustomPropertyClaim, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/oidc/customization/properties/repo", org) + return s.setOIDCCustomPropertyClaim(ctx, u, body) +} + +func (s *ActionsService) setOIDCCustomPropertyClaim(ctx context.Context, url string, body OIDCCustomPropertyClaim) (*OIDCCustomPropertyClaim, *Response, error) { + req, err := s.client.NewRequest(ctx, "POST", url, body) + if err != nil { + return nil, nil, err + } + + var customProperty *OIDCCustomPropertyClaim + resp, err := s.client.Do(req, &customProperty) + if err != nil { + return nil, resp, err + } + return customProperty, resp, err +} + +// DeleteEnterpriseOIDCCustomPropertyClaim deletes a custom property claim in oidc for enterprise actions. +// +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#delete-an-oidc-custom-property-inclusion-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name} +func (s *ActionsService) DeleteEnterpriseOIDCCustomPropertyClaim(ctx context.Context, enterprise, customProperty string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/oidc/customization/properties/repo/%v", enterprise, customProperty) + return s.deleteOIDCCustomPropertyClaim(ctx, u) +} + +// DeleteOrgOIDCCustomPropertyClaim deletes a custom property claim in oidc for organization actions. +// +// GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#delete-an-oidc-custom-property-inclusion-for-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name} +func (s *ActionsService) DeleteOrgOIDCCustomPropertyClaim(ctx context.Context, enterprise, customProperty string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/oidc/customization/properties/repo/%v", enterprise, customProperty) + return s.deleteOIDCCustomPropertyClaim(ctx, u) +} + +func (s *ActionsService) deleteOIDCCustomPropertyClaim(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest(ctx, "DELETE", url, nil) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go index 7eb082e1ad7..47f41af62c5 100644 --- a/github/actions_oidc_test.go +++ b/github/actions_oidc_test.go @@ -182,3 +182,217 @@ func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testin return client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, "o", "r", input) }) } + +func TestActionsService_ListEnterpriseOIDCCustomPropertyClaims(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/actions/oidc/customization/properties/repo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{"custom_property_name": "environment","inclusion_source": "enterprise"},{"custom_property_name": "lane","inclusion_source": "enterprise"}]`) + }) + + ctx := t.Context() + claims, _, err := client.Actions.ListEnterpriseOIDCCustomPropertyClaims(ctx, "e") + if err != nil { + t.Errorf("Actions.ListEnterpriseOIDCCustomPropertyClaims returned error: %v", err) + } + + want := []*OIDCCustomPropertyClaim{ + {CustomPropertyName: Ptr("environment"), InclusionSource: Ptr(InclusionSourceEnterprise)}, + {CustomPropertyName: Ptr("lane"), InclusionSource: Ptr(InclusionSourceEnterprise)}, + } + + if !cmp.Equal(claims, want) { + t.Errorf("Actions.ListEnterpriseOIDCCustomPropertyClaims returned %+v, want %+v", claims, want) + } + + const methodName = "ListEnterpriseOIDCCustomPropertyClaims" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListEnterpriseOIDCCustomPropertyClaims(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListEnterpriseOIDCCustomPropertyClaims(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_ListOrgOIDCCustomPropertyClaims(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/oidc/customization/properties/repo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + fmt.Fprint(w, `[{"custom_property_name": "environment","inclusion_source": "organization"},{"custom_property_name": "lane","inclusion_source": "organization"}]`) + }) + + ctx := t.Context() + claims, _, err := client.Actions.ListOrgOIDCCustomPropertyClaims(ctx, "o") + if err != nil { + t.Errorf("Actions.ListOrgOIDCCustomPropertyClaims returned error: %v", err) + } + + want := []*OIDCCustomPropertyClaim{ + {CustomPropertyName: Ptr("environment"), InclusionSource: Ptr(InclusionSourceOrganization)}, + {CustomPropertyName: Ptr("lane"), InclusionSource: Ptr(InclusionSourceOrganization)}, + } + + if !cmp.Equal(claims, want) { + t.Errorf("Actions.ListOrgOIDCCustomPropertyClaims returned %+v, want %+v", claims, want) + } + + const methodName = "ListOrgOIDCCustomPropertyClaims" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.ListOrgOIDCCustomPropertyClaims(ctx, "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.ListOrgOIDCCustomPropertyClaims(ctx, "o") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_SetEnterpriseOIDCCustomPropertyClaim(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := OIDCCustomPropertyClaim{ + CustomPropertyName: Ptr("environment"), + } + + mux.HandleFunc("/enterprises/e/actions/oidc/customization/properties/repo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Content-Type", "application/json") + testJSONBody(t, r, input) + w.WriteHeader(http.StatusCreated) + fmt.Fprint(w, `{"custom_property_name": "environment"}`) + }) + + ctx := t.Context() + property, _, err := client.Actions.SetEnterpriseOIDCCustomPropertyClaim(ctx, "e", input) + if err != nil { + t.Errorf("Actions.SetEnterpriseOIDCCustomPropertyClaim returned error: %v", err) + } + + want := &OIDCCustomPropertyClaim{CustomPropertyName: Ptr("environment")} + if !cmp.Equal(property, want) { + t.Errorf("Actions.SetEnterpriseOIDCCustomPropertyClaim returned %+v, want %+v", property, want) + } + + const methodName = "SetEnterpriseOIDCCustomPropertyClaim" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.SetEnterpriseOIDCCustomPropertyClaim(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.SetEnterpriseOIDCCustomPropertyClaim(ctx, "e", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_SetOrgOIDCCustomPropertyClaim(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + input := OIDCCustomPropertyClaim{ + CustomPropertyName: Ptr("environment"), + } + + mux.HandleFunc("/orgs/o/actions/oidc/customization/properties/repo", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "POST") + testHeader(t, r, "Content-Type", "application/json") + testJSONBody(t, r, input) + w.WriteHeader(http.StatusCreated) + fmt.Fprint(w, `{"custom_property_name": "environment"}`) + }) + + ctx := t.Context() + property, _, err := client.Actions.SetOrgOIDCCustomPropertyClaim(ctx, "o", input) + if err != nil { + t.Errorf("Actions.SetOrgOIDCCustomPropertyClaim returned error: %v", err) + } + + want := &OIDCCustomPropertyClaim{CustomPropertyName: Ptr("environment")} + if !cmp.Equal(property, want) { + t.Errorf("Actions.SetOrgOIDCCustomPropertyClaim returned %+v, want %+v", property, want) + } + + const methodName = "SetOrgOIDCCustomPropertyClaim" + + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Actions.SetOrgOIDCCustomPropertyClaim(ctx, "\n", input) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Actions.SetOrgOIDCCustomPropertyClaim(ctx, "o", input) + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestActionsService_DeleteEnterpriseOIDCCustomPropertyClaim(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/enterprises/e/actions/oidc/customization/properties/repo/environment", func(_ http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := t.Context() + _, err := client.Actions.DeleteEnterpriseOIDCCustomPropertyClaim(ctx, "e", "environment") + if err != nil { + t.Errorf("Actions.DeleteEnterpriseOIDCCustomPropertyClaim return error: %v", err) + } + + const methodName = "DeleteEnterpriseOIDCCustomPropertyClaim" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteEnterpriseOIDCCustomPropertyClaim(ctx, "\n", "environment") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteEnterpriseOIDCCustomPropertyClaim(ctx, "e", "r") + }) +} + +func TestActionsService_DeleteOrgOIDCCustomPropertyClaim(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/orgs/o/actions/oidc/customization/properties/repo/environment", func(_ http.ResponseWriter, r *http.Request) { + testMethod(t, r, "DELETE") + }) + + ctx := t.Context() + _, err := client.Actions.DeleteOrgOIDCCustomPropertyClaim(ctx, "o", "environment") + if err != nil { + t.Errorf("Actions.DeleteOrgOIDCCustomPropertyClaim return error: %v", err) + } + + const methodName = "DeleteOrgOIDCCustomPropertyClaim" + testBadOptions(t, methodName, func() (err error) { + _, err = client.Actions.DeleteOrgOIDCCustomPropertyClaim(ctx, "\n", "environment") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + return client.Actions.DeleteOrgOIDCCustomPropertyClaim(ctx, "o", "r") + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 138f841b5f2..5a1f8db57ea 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -25342,6 +25342,22 @@ func (o *OAuthAPP) GetURL() string { return *o.URL } +// GetCustomPropertyName returns the CustomPropertyName field if it's non-nil, zero value otherwise. +func (o *OIDCCustomPropertyClaim) GetCustomPropertyName() string { + if o == nil || o.CustomPropertyName == nil { + return "" + } + return *o.CustomPropertyName +} + +// GetInclusionSource returns the InclusionSource field. +func (o *OIDCCustomPropertyClaim) GetInclusionSource() *InclusionSource { + if o == nil { + return nil + } + return o.InclusionSource +} + // GetIncludeClaimKeys returns the IncludeClaimKeys slice if it's non-nil, nil otherwise. func (o *OIDCSubjectClaimCustomTemplate) GetIncludeClaimKeys() []string { if o == nil || o.IncludeClaimKeys == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 186fc7254db..1a6d6dd8336 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -31784,6 +31784,25 @@ func TestOAuthAPP_GetURL(tt *testing.T) { o.GetURL() } +func TestOIDCCustomPropertyClaim_GetCustomPropertyName(tt *testing.T) { + tt.Parallel() + var zeroValue string + o := &OIDCCustomPropertyClaim{CustomPropertyName: &zeroValue} + o.GetCustomPropertyName() + o = &OIDCCustomPropertyClaim{} + o.GetCustomPropertyName() + o = nil + o.GetCustomPropertyName() +} + +func TestOIDCCustomPropertyClaim_GetInclusionSource(tt *testing.T) { + tt.Parallel() + o := &OIDCCustomPropertyClaim{} + o.GetInclusionSource() + o = nil + o.GetInclusionSource() +} + func TestOIDCSubjectClaimCustomTemplate_GetIncludeClaimKeys(tt *testing.T) { tt.Parallel() zeroValue := []string{} From 23e302209aa8e70886996b845adb016203de41e5 Mon Sep 17 00:00:00 2001 From: Stephanie Swaney Date: Sat, 25 Jul 2026 16:31:10 -0700 Subject: [PATCH 2/5] chore: update openapi_operations.yaml --- openapi_operations.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/openapi_operations.yaml b/openapi_operations.yaml index 9fcda0cd38b..a83e3cb6e8b 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -105,7 +105,7 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: 03ca9c1cac754ec9b8369dc75de8a8c753c6e087 +openapi_commit: 16bc535ad66fac59d585b1516d1d52f58f787962 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root @@ -1212,10 +1212,18 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-all-credential-authorizations-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/credential-authorizations/revoke-credential-type + documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-a-single-credential-type-for-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json - name: POST /enterprises/{enterprise}/credential-authorizations/{username}/revoke documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-credential-authorizations-for-a-user-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json + - name: POST /enterprises/{enterprise}/credential-authorizations/{username}/revoke-credential-type + documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-a-single-credential-type-for-a-user-in-an-enterprise + openapi_files: + - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise openapi_files: @@ -6776,6 +6784,21 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json + - name: GET /repos/{owner}/{repo}/issues/{issue_number}/suggestions + documentation_url: https://docs.github.com/rest/issues/issues#list-issue-suggestions + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve + documentation_url: https://docs.github.com/rest/issues/issues#approve-an-issue-suggestion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json + - name: POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss + documentation_url: https://docs.github.com/rest/issues/issues#dismiss-an-issue-suggestion + openapi_files: + - descriptions/api.github.com/api.github.com.json + - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: From c45355e13642627bb37c71a839caa54c1f041529 Mon Sep 17 00:00:00 2001 From: Stephanie Swaney Date: Sat, 25 Jul 2026 16:57:26 -0700 Subject: [PATCH 3/5] chore: revert change from metadata script --- openapi_operations.yaml | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/openapi_operations.yaml b/openapi_operations.yaml index a83e3cb6e8b..9fcda0cd38b 100644 --- a/openapi_operations.yaml +++ b/openapi_operations.yaml @@ -105,7 +105,7 @@ operation_overrides: documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build - name: GET /repos/{owner}/{repo}/pages/builds/{build_id} documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build -openapi_commit: 16bc535ad66fac59d585b1516d1d52f58f787962 +openapi_commit: 03ca9c1cac754ec9b8369dc75de8a8c753c6e087 openapi_operations: - name: GET / documentation_url: https://docs.github.com/rest/meta/meta#github-api-root @@ -1212,18 +1212,10 @@ openapi_operations: documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-all-credential-authorizations-for-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - name: POST /enterprises/{enterprise}/credential-authorizations/revoke-credential-type - documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-a-single-credential-type-for-an-enterprise - openapi_files: - - descriptions/ghec/ghec.json - name: POST /enterprises/{enterprise}/credential-authorizations/{username}/revoke documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-credential-authorizations-for-a-user-in-an-enterprise openapi_files: - descriptions/ghec/ghec.json - - name: POST /enterprises/{enterprise}/credential-authorizations/{username}/revoke-credential-type - documentation_url: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/credential-authorizations#revoke-a-single-credential-type-for-a-user-in-an-enterprise - openapi_files: - - descriptions/ghec/ghec.json - name: GET /enterprises/{enterprise}/dependabot/alerts documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise openapi_files: @@ -6784,21 +6776,6 @@ openapi_operations: openapi_files: - descriptions/api.github.com/api.github.com.json - descriptions/ghec/ghec.json - - name: GET /repos/{owner}/{repo}/issues/{issue_number}/suggestions - documentation_url: https://docs.github.com/rest/issues/issues#list-issue-suggestions - openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - name: POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/approve - documentation_url: https://docs.github.com/rest/issues/issues#approve-an-issue-suggestion - openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - - name: POST /repos/{owner}/{repo}/issues/{issue_number}/suggestions/{suggestion_id}/dismiss - documentation_url: https://docs.github.com/rest/issues/issues#dismiss-an-issue-suggestion - openapi_files: - - descriptions/api.github.com/api.github.com.json - - descriptions/ghec/ghec.json - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue openapi_files: From 477db182989417ed8eb8f6b52c28124ac0e2c42e Mon Sep 17 00:00:00 2001 From: sswane <36286083+sswane@users.noreply.github.com> Date: Sun, 26 Jul 2026 08:47:47 -0700 Subject: [PATCH 4/5] fix: Update github/actions_oidc.go with correct convention Co-authored-by: Dhananjay Mishra --- github/actions_oidc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index 63fddff0111..e1cd29a3151 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -93,8 +93,8 @@ const ( // OIDCCustomPropertyClaim represents an OIDC custom property claim for GitHub Actions. type OIDCCustomPropertyClaim struct { - CustomPropertyName *string `json:"custom_property_name,omitempty"` - InclusionSource *InclusionSource `json:"inclusion_source,omitempty"` + CustomPropertyName string `json:"custom_property_name"` + InclusionSource InclusionSource `json:"inclusion_source"` } // ListEnterpriseOIDCCustomPropertyClaims lists the custom property claims in oidc for enterprise actions. From 274c01d79345422fa81fca76101cb4115c84d729 Mon Sep 17 00:00:00 2001 From: Stephanie Swaney Date: Sun, 26 Jul 2026 09:20:08 -0700 Subject: [PATCH 5/5] fix: add another type for response since includes another field --- github/actions_oidc.go | 17 +++++++++++------ github/actions_oidc_test.go | 20 ++++++++++---------- github/github-accessors.go | 10 +++++----- github/github-accessors_test.go | 9 +++------ 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/github/actions_oidc.go b/github/actions_oidc.go index e1cd29a3151..d0cf78ffaa7 100644 --- a/github/actions_oidc.go +++ b/github/actions_oidc.go @@ -93,8 +93,13 @@ const ( // OIDCCustomPropertyClaim represents an OIDC custom property claim for GitHub Actions. type OIDCCustomPropertyClaim struct { - CustomPropertyName string `json:"custom_property_name"` - InclusionSource InclusionSource `json:"inclusion_source"` + CustomPropertyName string `json:"custom_property_name"` +} + +// OIDCCustomPropertyClaimResponse represents the OIDC custom property claim along with the inclusion source (enterprise or organization) for GitHub Actions. +type OIDCCustomPropertyClaimResponse struct { + OIDCCustomPropertyClaim + InclusionSource InclusionSource `json:"inclusion_source"` } // ListEnterpriseOIDCCustomPropertyClaims lists the custom property claims in oidc for enterprise actions. @@ -102,7 +107,7 @@ type OIDCCustomPropertyClaim struct { // GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#list-oidc-custom-property-inclusions-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/oidc/customization/properties/repo -func (s *ActionsService) ListEnterpriseOIDCCustomPropertyClaims(ctx context.Context, enterprise string) ([]*OIDCCustomPropertyClaim, *Response, error) { +func (s *ActionsService) ListEnterpriseOIDCCustomPropertyClaims(ctx context.Context, enterprise string) ([]*OIDCCustomPropertyClaimResponse, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/oidc/customization/properties/repo", enterprise) return s.listOIDCCustomPropertyClaims(ctx, u) } @@ -112,18 +117,18 @@ func (s *ActionsService) ListEnterpriseOIDCCustomPropertyClaims(ctx context.Cont // GitHub API docs: https://docs.github.com/rest/actions/oidc?apiVersion=2022-11-28#list-oidc-custom-property-inclusions-for-an-organization // //meta:operation GET /orgs/{org}/actions/oidc/customization/properties/repo -func (s *ActionsService) ListOrgOIDCCustomPropertyClaims(ctx context.Context, org string) ([]*OIDCCustomPropertyClaim, *Response, error) { +func (s *ActionsService) ListOrgOIDCCustomPropertyClaims(ctx context.Context, org string) ([]*OIDCCustomPropertyClaimResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/actions/oidc/customization/properties/repo", org) return s.listOIDCCustomPropertyClaims(ctx, u) } -func (s *ActionsService) listOIDCCustomPropertyClaims(ctx context.Context, url string) ([]*OIDCCustomPropertyClaim, *Response, error) { +func (s *ActionsService) listOIDCCustomPropertyClaims(ctx context.Context, url string) ([]*OIDCCustomPropertyClaimResponse, *Response, error) { req, err := s.client.NewRequest(ctx, "GET", url, nil) if err != nil { return nil, nil, err } - var props []*OIDCCustomPropertyClaim + var props []*OIDCCustomPropertyClaimResponse resp, err := s.client.Do(req, &props) if err != nil { return nil, resp, err diff --git a/github/actions_oidc_test.go b/github/actions_oidc_test.go index 47f41af62c5..710012bf469 100644 --- a/github/actions_oidc_test.go +++ b/github/actions_oidc_test.go @@ -198,9 +198,9 @@ func TestActionsService_ListEnterpriseOIDCCustomPropertyClaims(t *testing.T) { t.Errorf("Actions.ListEnterpriseOIDCCustomPropertyClaims returned error: %v", err) } - want := []*OIDCCustomPropertyClaim{ - {CustomPropertyName: Ptr("environment"), InclusionSource: Ptr(InclusionSourceEnterprise)}, - {CustomPropertyName: Ptr("lane"), InclusionSource: Ptr(InclusionSourceEnterprise)}, + want := []*OIDCCustomPropertyClaimResponse{ + {OIDCCustomPropertyClaim: OIDCCustomPropertyClaim{"environment"}, InclusionSource: InclusionSourceEnterprise}, + {OIDCCustomPropertyClaim: OIDCCustomPropertyClaim{"lane"}, InclusionSource: InclusionSourceEnterprise}, } if !cmp.Equal(claims, want) { @@ -237,9 +237,9 @@ func TestActionsService_ListOrgOIDCCustomPropertyClaims(t *testing.T) { t.Errorf("Actions.ListOrgOIDCCustomPropertyClaims returned error: %v", err) } - want := []*OIDCCustomPropertyClaim{ - {CustomPropertyName: Ptr("environment"), InclusionSource: Ptr(InclusionSourceOrganization)}, - {CustomPropertyName: Ptr("lane"), InclusionSource: Ptr(InclusionSourceOrganization)}, + want := []*OIDCCustomPropertyClaimResponse{ + {OIDCCustomPropertyClaim: OIDCCustomPropertyClaim{"environment"}, InclusionSource: InclusionSourceOrganization}, + {OIDCCustomPropertyClaim: OIDCCustomPropertyClaim{"lane"}, InclusionSource: InclusionSourceOrganization}, } if !cmp.Equal(claims, want) { @@ -266,7 +266,7 @@ func TestActionsService_SetEnterpriseOIDCCustomPropertyClaim(t *testing.T) { client, mux, _ := setup(t) input := OIDCCustomPropertyClaim{ - CustomPropertyName: Ptr("environment"), + CustomPropertyName: "environment", } mux.HandleFunc("/enterprises/e/actions/oidc/customization/properties/repo", func(w http.ResponseWriter, r *http.Request) { @@ -283,7 +283,7 @@ func TestActionsService_SetEnterpriseOIDCCustomPropertyClaim(t *testing.T) { t.Errorf("Actions.SetEnterpriseOIDCCustomPropertyClaim returned error: %v", err) } - want := &OIDCCustomPropertyClaim{CustomPropertyName: Ptr("environment")} + want := &OIDCCustomPropertyClaim{CustomPropertyName: "environment"} if !cmp.Equal(property, want) { t.Errorf("Actions.SetEnterpriseOIDCCustomPropertyClaim returned %+v, want %+v", property, want) } @@ -309,7 +309,7 @@ func TestActionsService_SetOrgOIDCCustomPropertyClaim(t *testing.T) { client, mux, _ := setup(t) input := OIDCCustomPropertyClaim{ - CustomPropertyName: Ptr("environment"), + CustomPropertyName: "environment", } mux.HandleFunc("/orgs/o/actions/oidc/customization/properties/repo", func(w http.ResponseWriter, r *http.Request) { @@ -326,7 +326,7 @@ func TestActionsService_SetOrgOIDCCustomPropertyClaim(t *testing.T) { t.Errorf("Actions.SetOrgOIDCCustomPropertyClaim returned error: %v", err) } - want := &OIDCCustomPropertyClaim{CustomPropertyName: Ptr("environment")} + want := &OIDCCustomPropertyClaim{CustomPropertyName: "environment"} if !cmp.Equal(property, want) { t.Errorf("Actions.SetOrgOIDCCustomPropertyClaim returned %+v, want %+v", property, want) } diff --git a/github/github-accessors.go b/github/github-accessors.go index 5a1f8db57ea..dd03ee414b1 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -25342,18 +25342,18 @@ func (o *OAuthAPP) GetURL() string { return *o.URL } -// GetCustomPropertyName returns the CustomPropertyName field if it's non-nil, zero value otherwise. +// GetCustomPropertyName returns the CustomPropertyName field. func (o *OIDCCustomPropertyClaim) GetCustomPropertyName() string { - if o == nil || o.CustomPropertyName == nil { + if o == nil { return "" } - return *o.CustomPropertyName + return o.CustomPropertyName } // GetInclusionSource returns the InclusionSource field. -func (o *OIDCCustomPropertyClaim) GetInclusionSource() *InclusionSource { +func (o *OIDCCustomPropertyClaimResponse) GetInclusionSource() InclusionSource { if o == nil { - return nil + return "" } return o.InclusionSource } diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 1a6d6dd8336..3c61a8e5d01 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -31786,18 +31786,15 @@ func TestOAuthAPP_GetURL(tt *testing.T) { func TestOIDCCustomPropertyClaim_GetCustomPropertyName(tt *testing.T) { tt.Parallel() - var zeroValue string - o := &OIDCCustomPropertyClaim{CustomPropertyName: &zeroValue} - o.GetCustomPropertyName() - o = &OIDCCustomPropertyClaim{} + o := &OIDCCustomPropertyClaim{} o.GetCustomPropertyName() o = nil o.GetCustomPropertyName() } -func TestOIDCCustomPropertyClaim_GetInclusionSource(tt *testing.T) { +func TestOIDCCustomPropertyClaimResponse_GetInclusionSource(tt *testing.T) { tt.Parallel() - o := &OIDCCustomPropertyClaim{} + o := &OIDCCustomPropertyClaimResponse{} o.GetInclusionSource() o = nil o.GetInclusionSource()