1
0
This commit is contained in:
Stephan 2021-12-16 13:59:02 +01:00
parent 04327b45b0
commit 561e1dcfde

View File

@ -47,15 +47,8 @@ jobs:
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo repo: context.repo.repo
}) })
console.log(projects) console.log(`retrieved ${projects.data.length} projects.`)
console.log(`retrieved ${projects.length} projects.`)
const project = firstOrDefault(projects.data, (x) => x.name === project_name) const project = firstOrDefault(projects.data, (x) => x.name === project_name)
//var project = null
//for (const p of projects) {
// if (p.name === project_name) {
// project = p
// }
//}
if (project === null) { if (project === null) {
core.setFailed(`Failed to find project "${project_name}".`) core.setFailed(`Failed to find project "${project_name}".`)
return return
@ -65,19 +58,20 @@ jobs:
} }
// find the column // find the column
console.log('find column...')
const columns = await github.projects.listColumns({ const columns = await github.projects.listColumns({
project_id: project.id project_id: project.id
}) })
var column = null console.log(columns)
for (const c of columns.data) { console.log(`retrieved ${columns.data.length} columns.`)
if (c.name === column_name) { const column = firstOrDefault(columns.data, (x) => x.name === column_name)
column = c
}
}
if (column === null) { if (column === null) {
core.setFailed(`Failed to find column "${column_name}" in project ${project.name}.`) core.setFailed(`Failed to find column "${column_name}" in project ${project.name}.`)
return return
} }
else {
console.log(`column id: ${column.id}`)
}
var content_type = null var content_type = null
if (github.event.name === 'issue') { if (github.event.name === 'issue') {