type Github = {
token: string;
};
/**
* Delete a GitHub Actions cache for a repository (using a cache ID)
* Deletes a GitHub Actions cache for a repository, using a cache ID.
You must authenticate using an access token with the `repo` scope to use this endpoint.
GitHub Apps must have the `actions:write` permission to use this endpoint.
*/
export async function main(
auth: Github,
owner: string,
repo: string,
cache_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/actions/caches/${cache_id}`
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 367 days ago
type Github = {
token: string;
};
/**
* Delete a GitHub Actions cache for a repository (using a cache ID)
* Deletes a GitHub Actions cache for a repository, using a cache ID.
You must authenticate using an access token with the `repo` scope to use this endpoint.
GitHub Apps must have the `actions:write` permission to use this endpoint.
*/
export async function main(
auth: Github,
owner: string,
repo: string,
cache_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/actions/caches/${cache_id}`
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 927 days ago