type Github = {
token: string;
};
/**
* Create a remove token for a repository
* Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.
You must authenticate using an access token with the `repo` scope to use this endpoint.
#### Example using remove token
To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.
```
./config.sh remove --token TOKEN
```
*/
export async function main(auth: Github, owner: string, repo: string) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/actions/runners/remove-token`
);
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 16 days ago
type Github = {
token: string;
};
/**
* Create a remove token for a repository
* Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.
You must authenticate using an access token with the `repo` scope to use this endpoint.
#### Example using remove token
To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.
```
./config.sh remove --token TOKEN
```
*/
export async function main(auth: Github, owner: string, repo: string) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/actions/runners/remove-token`
);
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 571 days ago
type Github = {
token: string;
};
/**
* Create a remove token for a repository
* Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.
You must authenticate using an access token with the `repo` scope to use this endpoint.
#### Example using remove token
To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.
```
./config.sh remove --token TOKEN
```
*/
export async function main(auth: Github, owner: string, repo: string) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/actions/runners/remove-auth.token`
);
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 576 days ago