From af84310aa0f523aee81addd9effce3e6df26556c Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 20 Dec 2021 19:07:11 +0100 Subject: [PATCH] fix --- .github/workflows/assign-to-project.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/assign-to-project.yml b/.github/workflows/assign-to-project.yml index a653c21..839424a 100644 --- a/.github/workflows/assign-to-project.yml +++ b/.github/workflows/assign-to-project.yml @@ -82,11 +82,17 @@ jobs: console.log('determine content type...') const event_name = context.eventName var content_type = null + var item_number = null + var item_id = null if (event_name === 'issues') { content_type = 'Issue' + item_number = context.issue.number + item_id = context.issue.id } if (event_name === 'pull_request_target') { content_type = 'PullRequest' + item_number = context.pull_request.number + item_id = context.pull_request.id } if (!content_type) { core.setFailed(`Unexpected event name "${event_name}".`) @@ -99,13 +105,10 @@ jobs: // get the item console.log('get the item...') console.log(context) - console.log(context.issue) - console.log(context.pull_request) - console.log(context.issue()) const item = await github.issues.get({ owner: context.repo.owner, repo: context.repo.repo, - issue_number: context.issue.number + issue_number: item_number }) if (!item) { core.setFailed(`Failed to get issue ${context.issue.number}.`) @@ -113,6 +116,7 @@ jobs: } else { console.log(`${content_type} #${context.issue.number} id: ${item.data.id}.`) + console.log(`was: ${item_id} and match?!`) } console.log('create the card...') @@ -120,7 +124,7 @@ jobs: await github.projects.createCard({ column_id: column.id, //note:, - content_id: item.data.id, + content_id: item_id, content_type: content_type }) console.log('created')