This commit is contained in:
Stephan 2022-01-10 18:39:14 +01:00
parent a7ff547627
commit 6a00c973fb
2 changed files with 7 additions and 5 deletions

View File

@ -13,7 +13,7 @@
// it's move to a project column for the first time - being assigned to the project // it's move to a project column for the first time - being assigned to the project
// and showing in project's backlog is not enough. // and showing in project's backlog is not enough.
module.exports = async ({github, context}) => { module.exports = async ({github, context, core}) => {
const restapi = github.rest const restapi = github.rest
@ -74,7 +74,7 @@ module.exports = async ({github, context}) => {
const [ itemType, itemNumber ] = last2(card.content_url) const [ itemType, itemNumber ] = last2(card.content_url)
var itemId var itemId
if (itemType == 'issue') { if (itemType == 'issues') {
const issueResponse = await restapi.issues.get({ const issueResponse = await restapi.issues.get({
owner: context.owner, owner: context.owner,
repo: context.repo, repo: context.repo,
@ -93,14 +93,16 @@ module.exports = async ({github, context}) => {
itemId = pullResponse.data.id itemId = pullResponse.data.id
} }
else { else {
console.log(`item: ${itemType} ??`) core.setFailed(`Unsupported item type ${itemType}`)
return
} }
console.log(`item: ${itemType}/${itemId}`) console.log(`item: ${itemType}/${itemId}`)
const milestones = await restapi.issues.listMilestones({ const milestonesResponse = await restapi.issues.listMilestones({
repo: context.repo, repo: context.repo,
owner: context.owner owner: context.owner
}) })
const milestones = milestonesResponse.data
console.log(milestones) console.log(milestones)
/* /*

View File

@ -43,4 +43,4 @@ jobs:
// current working directory. // current working directory.
const script = require('./.github/workflows/assign-milestones.js') const script = require('./.github/workflows/assign-milestones.js')
await script({github, context}) await script({github, context, core})