MCPcopy Create free account
hub / github.com/kriasoft/graphql-starter-kit / deleteDeployment

Function deleteDeployment

scripts/github.js:67–85  ·  view source on GitHub ↗

* https://docs.github.com/en/rest/reference/repos#delete-a-deployment

(options = {})

Source from the content-addressed store, hash-verified

65 * https://docs.github.com/en/rest/reference/repos#delete-a-deployment
66 */
67async function deleteDeployment(options = {}) {
68 const [owner, repo] = env.GITHUB_REPOSITORY?.split("/") ?? [];
69 const gh = new Octokit({ auth: env.GITHUB_TOKEN });
70
71 let res = await gh.repos.getDeployment({
72 owner,
73 repo,
74 deployment_id: options.id,
75 });
76
77 if (res.status === 200) {
78 console.log(`Deleting deployment # ${options.id} ...`);
79 res = await gh.repos.deleteDeployment({
80 owner,
81 repo,
82 deployment_id: options.id,
83 });
84 }
85}
86
87/**
88 * https://docs.github.com/en/rest/reference/repos#create-a-deployment-status

Callers 1

github.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected