Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f495ea391f | ||
|
|
d19798dfea | ||
|
|
0812a9be37 |
@@ -22,7 +22,9 @@ export function issueLabel(config: Config, queue: TaskQueue) {
|
||||
return async (c: Context) => {
|
||||
const event = await c.req.json<IssueEvent>();
|
||||
|
||||
if (event.action !== "label_updated" && event.action !== "labeled") {
|
||||
console.log(`[issue-label] action="${event.action}" issue=#${event.issue.number} labels=[${event.issue.labels.map((l) => l.name).join(", ")}]`);
|
||||
|
||||
if (!["labeled", "label_updated", "created"].includes(event.action)) {
|
||||
return c.text("ignored: not a label event", 200);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@ export function prRework(config: Config, queue: TaskQueue) {
|
||||
return c.text("ignored: not a reviewed event", 200);
|
||||
}
|
||||
|
||||
if (!event.review) {
|
||||
return c.text("ignored: no review data", 200);
|
||||
}
|
||||
|
||||
const [org, repo] = event.repository.full_name.split("/");
|
||||
const prNumber = event.pull_request.number;
|
||||
const reviewState = event.review.state.toLowerCase();
|
||||
|
||||
@@ -109,12 +109,14 @@ export class CoderClient {
|
||||
|
||||
async deleteWorkspace(workspaceId: string): Promise<void> {
|
||||
const res = await fetch(
|
||||
`${this.baseUrl}/api/v2/workspaces/${workspaceId}`,
|
||||
`${this.baseUrl}/api/v2/workspaces/${workspaceId}/builds`,
|
||||
{
|
||||
method: "DELETE",
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Coder-Session-Token": this.token,
|
||||
},
|
||||
body: JSON.stringify({ transition: "delete" }),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user