Skip to content

Commit eaa3b4a

Browse files
committed
fixup! feat: Refactor repositories download contents
1 parent 5069e18 commit eaa3b4a

2 files changed

Lines changed: 86 additions & 15 deletions

File tree

openapi_operations.yaml

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ operation_overrides:
2727
documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build
2828
- name: GET /repos/{owner}/{repo}/pages/builds/{build_id}
2929
documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build
30-
openapi_commit: 4e819bd9aa9411232e1c34e7d1ffaaffc224e94b
30+
openapi_commit: e6a345665a64530821d4ebcd07e7805a0cdeff09
3131
openapi_operations:
3232
- name: GET /
3333
documentation_url: https://docs.github.com/rest/meta/meta#github-api-root
@@ -586,6 +586,21 @@ openapi_operations:
586586
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise
587587
openapi_files:
588588
- descriptions/ghec/ghec.json
589+
- name: GET /enterprises/{enterprise}/actions/oidc/customization/properties/repo
590+
documentation_url: https://docs.github.com/rest/actions/oidc#list-oidc-custom-property-inclusions-for-an-enterprise
591+
openapi_files:
592+
- descriptions/api.github.com/api.github.com.json
593+
- descriptions/ghec/ghec.json
594+
- name: POST /enterprises/{enterprise}/actions/oidc/customization/properties/repo
595+
documentation_url: https://docs.github.com/rest/actions/oidc#create-an-oidc-custom-property-inclusion-for-an-enterprise
596+
openapi_files:
597+
- descriptions/api.github.com/api.github.com.json
598+
- descriptions/ghec/ghec.json
599+
- name: DELETE /enterprises/{enterprise}/actions/oidc/customization/properties/repo/{custom_property_name}
600+
documentation_url: https://docs.github.com/rest/actions/oidc#delete-an-oidc-custom-property-inclusion-for-an-enterprise
601+
openapi_files:
602+
- descriptions/api.github.com/api.github.com.json
603+
- descriptions/ghec/ghec.json
589604
- name: GET /enterprises/{enterprise}/actions/permissions
590605
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise
591606
openapi_files:
@@ -1025,27 +1040,35 @@ openapi_operations:
10251040
openapi_files:
10261041
- descriptions/ghec/ghec.json
10271042
- name: GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day
1028-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics-for-a-specific-day
1043+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics-for-a-specific-day
10291044
openapi_files:
1045+
- descriptions/api.github.com/api.github.com.json
10301046
- descriptions/ghec/ghec.json
10311047
- name: GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest
1032-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics
1048+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics
10331049
openapi_files:
1050+
- descriptions/api.github.com/api.github.com.json
10341051
- descriptions/ghec/ghec.json
10351052
- name: GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day
1036-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics-for-a-specific-day
1053+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics-for-a-specific-day
10371054
openapi_files:
1055+
- descriptions/api.github.com/api.github.com.json
10381056
- descriptions/ghec/ghec.json
10391057
- name: GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest
1040-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics
1058+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics
10411059
openapi_files:
1060+
- descriptions/api.github.com/api.github.com.json
10421061
- descriptions/ghec/ghec.json
10431062
- name: GET /enterprises/{enterprise}/dependabot/alerts
10441063
documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise
10451064
openapi_files:
10461065
- descriptions/api.github.com/api.github.com.json
10471066
- descriptions/ghec/ghec.json
10481067
- descriptions/ghes-3.20/ghes-3.20.json
1068+
- name: GET /enterprises/{enterprise}/dismissal-requests/secret-scanning
1069+
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#list-alert-dismissal-requests-for-secret-scanning-for-an-enterprise
1070+
openapi_files:
1071+
- descriptions/ghec/ghec.json
10491072
- name: GET /enterprises/{enterprise}/enterprise-roles
10501073
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#get-all-enterprise-roles-for-an-enterprise
10511074
openapi_files:
@@ -1955,6 +1978,21 @@ openapi_operations:
19551978
openapi_files:
19561979
- descriptions/api.github.com/api.github.com.json
19571980
- descriptions/ghec/ghec.json
1981+
- name: GET /orgs/{org}/actions/oidc/customization/properties/repo
1982+
documentation_url: https://docs.github.com/rest/actions/oidc#list-oidc-custom-property-inclusions-for-an-organization
1983+
openapi_files:
1984+
- descriptions/api.github.com/api.github.com.json
1985+
- descriptions/ghec/ghec.json
1986+
- name: POST /orgs/{org}/actions/oidc/customization/properties/repo
1987+
documentation_url: https://docs.github.com/rest/actions/oidc#create-an-oidc-custom-property-inclusion-for-an-organization
1988+
openapi_files:
1989+
- descriptions/api.github.com/api.github.com.json
1990+
- descriptions/ghec/ghec.json
1991+
- name: DELETE /orgs/{org}/actions/oidc/customization/properties/repo/{custom_property_name}
1992+
documentation_url: https://docs.github.com/rest/actions/oidc#delete-an-oidc-custom-property-inclusion-for-an-organization
1993+
openapi_files:
1994+
- descriptions/api.github.com/api.github.com.json
1995+
- descriptions/ghec/ghec.json
19581996
- name: GET /orgs/{org}/actions/oidc/customization/sub
19591997
documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization
19601998
openapi_files:
@@ -2653,6 +2691,36 @@ openapi_operations:
26532691
openapi_files:
26542692
- descriptions/api.github.com/api.github.com.json
26552693
- descriptions/ghec/ghec.json
2694+
- name: GET /orgs/{org}/copilot/coding-agent/permissions
2695+
documentation_url: https://docs.github.com/rest/copilot/copilot-coding-agent-management#get-copilot-coding-agent-permissions-for-an-organization
2696+
openapi_files:
2697+
- descriptions/api.github.com/api.github.com.json
2698+
- descriptions/ghec/ghec.json
2699+
- name: PUT /orgs/{org}/copilot/coding-agent/permissions
2700+
documentation_url: https://docs.github.com/rest/copilot/copilot-coding-agent-management#set-copilot-coding-agent-permissions-for-an-organization
2701+
openapi_files:
2702+
- descriptions/api.github.com/api.github.com.json
2703+
- descriptions/ghec/ghec.json
2704+
- name: GET /orgs/{org}/copilot/coding-agent/permissions/repositories
2705+
documentation_url: https://docs.github.com/rest/copilot/copilot-coding-agent-management#list-repositories-enabled-for-copilot-coding-agent-in-an-organization
2706+
openapi_files:
2707+
- descriptions/api.github.com/api.github.com.json
2708+
- descriptions/ghec/ghec.json
2709+
- name: PUT /orgs/{org}/copilot/coding-agent/permissions/repositories
2710+
documentation_url: https://docs.github.com/rest/copilot/copilot-coding-agent-management#set-selected-repositories-for-copilot-coding-agent-in-an-organization
2711+
openapi_files:
2712+
- descriptions/api.github.com/api.github.com.json
2713+
- descriptions/ghec/ghec.json
2714+
- name: DELETE /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}
2715+
documentation_url: https://docs.github.com/rest/copilot/copilot-coding-agent-management#disable-a-repository-for-copilot-coding-agent-in-an-organization
2716+
openapi_files:
2717+
- descriptions/api.github.com/api.github.com.json
2718+
- descriptions/ghec/ghec.json
2719+
- name: PUT /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id}
2720+
documentation_url: https://docs.github.com/rest/copilot/copilot-coding-agent-management#enable-a-repository-for-copilot-coding-agent-in-an-organization
2721+
openapi_files:
2722+
- descriptions/api.github.com/api.github.com.json
2723+
- descriptions/ghec/ghec.json
26562724
- name: GET /orgs/{org}/copilot/content_exclusion
26572725
documentation_url: https://docs.github.com/rest/copilot/copilot-content-exclusion-management#get-copilot-content-exclusion-rules-for-an-organization
26582726
openapi_files:
@@ -2669,20 +2737,24 @@ openapi_operations:
26692737
- descriptions/api.github.com/api.github.com.json
26702738
- descriptions/ghec/ghec.json
26712739
- name: GET /orgs/{org}/copilot/metrics/reports/organization-1-day
2672-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics-for-a-specific-day
2740+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics-for-a-specific-day
26732741
openapi_files:
2742+
- descriptions/api.github.com/api.github.com.json
26742743
- descriptions/ghec/ghec.json
26752744
- name: GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest
2676-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics
2745+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics
26772746
openapi_files:
2747+
- descriptions/api.github.com/api.github.com.json
26782748
- descriptions/ghec/ghec.json
26792749
- name: GET /orgs/{org}/copilot/metrics/reports/users-1-day
2680-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics-for-a-specific-day
2750+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics-for-a-specific-day
26812751
openapi_files:
2752+
- descriptions/api.github.com/api.github.com.json
26822753
- descriptions/ghec/ghec.json
26832754
- name: GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest
2684-
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics
2755+
documentation_url: https://docs.github.com/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics
26852756
openapi_files:
2757+
- descriptions/api.github.com/api.github.com.json
26862758
- descriptions/ghec/ghec.json
26872759
- name: GET /orgs/{org}/credential-authorizations
26882760
documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization

tools/metadata/main_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,12 @@ func newTestServer(t *testing.T, ref string, files map[string]any) *httptest.Ser
362362
descriptionsContent = append(descriptionsContent, &github.RepositoryContent{
363363
Name: github.Ptr(path.Base(path.Dir(name))),
364364
})
365+
dlURL := server.URL + "/dl/" + name
365366
mux.HandleFunc(
366-
path.Join(repoPath, "contents/descriptions", path.Dir(name)),
367-
jsonHandler(refQuery, []*github.RepositoryContent{
368-
{
369-
Name: github.Ptr(path.Base(name)),
370-
DownloadURL: github.Ptr(server.URL + "/dl/" + name),
371-
},
367+
path.Join(repoPath, "contents/descriptions", name),
368+
jsonHandler(refQuery, &github.RepositoryContent{
369+
Name: github.Ptr(path.Base(name)),
370+
DownloadURL: github.Ptr(dlURL),
372371
}),
373372
)
374373
mux.HandleFunc(

0 commit comments

Comments
 (0)