From 2926b8c82d356372ebe5df740555e274b5d48612 Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 10 Jan 2022 15:16:02 +0100 Subject: [PATCH] fix --- .github/workflows/assign-milestones.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assign-milestones.js b/.github/workflows/assign-milestones.js index 2f777a2..ddae2f1 100644 --- a/.github/workflows/assign-milestones.js +++ b/.github/workflows/assign-milestones.js @@ -40,15 +40,29 @@ module.exports = async ({github, context}) => { console.log(`event: ${eventName}/${eventAction}`) const columnId = context.payload.project_card.column_id - const column = await restapi.projects.getColumn({ + const columnResponse = await restapi.projects.getColumn({ column_id: columnId }) + const column = columnResponse.data console.log(column) + function meh(s) { + const pos = s.lastIndexOf('/') + return s.substring(pos+1) + } + + const projectId = meh(column.project_url) + const projectResponse = await restapi.projects.getProject({ + project_id: projectId + }); + const project = projectResponse.data + console.log(project) + const cardId = context.payload.project_card.id - const card = await restapi.projects.getCard({ + const cardResponse = await restapi.projects.getCard({ card_id: cardId }) + const card = cardResponse.data console.log(card) const milestones = await restapi.issues.listMilestones({