Skip to content

Commit f64a449

Browse files
committed
Add links to API docs
1 parent 7fc86e0 commit f64a449

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

src/api-client.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export async function getGitHubVersionFromApi(
128128

129129
// Doesn't strictly have to be the meta endpoint as we're only
130130
// using the response headers which are available on every request.
131+
//
132+
// See https://docs.github.com/en/rest/meta/meta#get-github-meta-information.
131133
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
132134
const response = await apiClient.rest.meta.get();
133135

@@ -164,6 +166,9 @@ export async function getGitHubVersion(): Promise<GitHubVersion> {
164166

165167
/**
166168
* Get the path of the currently executing workflow relative to the repository root.
169+
*
170+
* See https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run
171+
* and https://docs.github.com/en/rest/actions/workflows#get-a-workflow.
167172
*/
168173
export async function getWorkflowRelativePath(): Promise<string> {
169174
const repo_nwo = getRepositoryNwo();
@@ -252,7 +257,11 @@ export interface ActionsCacheItem {
252257
size_in_bytes?: number;
253258
}
254259

255-
/** List all Actions cache entries starting with the provided key prefix and matching the provided ref. */
260+
/**
261+
* List all Actions cache entries starting with the provided key prefix and matching the provided ref.
262+
*
263+
* See https://docs.github.com/en/rest/actions/cache#list-github-actions-caches-for-a-repository.
264+
*/
256265
export async function listActionsCaches(
257266
keyPrefix: string,
258267
ref?: string,
@@ -270,7 +279,11 @@ export async function listActionsCaches(
270279
);
271280
}
272281

273-
/** Delete an Actions cache item by its ID. */
282+
/**
283+
* Delete an Actions cache item by its ID.
284+
*
285+
* See https://docs.github.com/en/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id.
286+
*/
274287
export async function deleteActionsCache(id: number) {
275288
const repositoryNwo = getRepositoryNwo();
276289

@@ -281,7 +294,11 @@ export async function deleteActionsCache(id: number) {
281294
});
282295
}
283296

284-
/** Retrieve all custom repository properties. */
297+
/**
298+
* Retrieve all custom repository properties.
299+
*
300+
* See https://docs.github.com/en/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository.
301+
*/
285302
export async function getRepositoryProperties(repositoryNwo: RepositoryNwo) {
286303
return getApiClient().request("GET /repos/:owner/:repo/properties/values", {
287304
owner: repositoryNwo.owner,

0 commit comments

Comments
 (0)