fix
This commit is contained in:
parent
4bf2ae8436
commit
3356fe58aa
83
.github/workflows/assign-to-project.yml
vendored
83
.github/workflows/assign-to-project.yml
vendored
|
@ -15,51 +15,52 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Assign
|
- name: Assign
|
||||||
uses: actions/github-script@v4
|
uses: actions/github-script@v4
|
||||||
script: |
|
with:
|
||||||
//const project_id = 2
|
script: |
|
||||||
//const column_name = 'Drafting'
|
//const project_id = 2
|
||||||
|
//const column_name = 'Drafting'
|
||||||
|
|
||||||
const project_id = 1
|
const project_id = 1
|
||||||
const column_name = 'To do'
|
const column_name = 'To do'
|
||||||
|
|
||||||
// find the column
|
// find the column
|
||||||
const columns = github.projects.listColumns({
|
const columns = github.projects.listColumns({
|
||||||
project_id: project_id
|
project_id: project_id
|
||||||
})
|
})
|
||||||
var column = null
|
var column = null
|
||||||
for (const c of columns) {
|
for (const c of columns) {
|
||||||
if (c.name === column_name) {
|
if (c.name === column_name) {
|
||||||
column = c
|
column = c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (c === null) {
|
||||||
|
core.setFailed(`Failed to find column "${column_name}" in project ${project_id}.`)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (c === null) {
|
|
||||||
core.setFailed(`Failed to find column "${column_name}" in project ${project_id}.`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var content_type = null
|
var content_type = null
|
||||||
if (github.event.name === 'issue') {
|
if (github.event.name === 'issue') {
|
||||||
content_type = 'Issue'
|
content_type = 'Issue'
|
||||||
}
|
}
|
||||||
if (github.event.name === 'pull_request') {
|
if (github.event.name === 'pull_request') {
|
||||||
content_type = 'PullRequest'
|
content_type = 'PullRequest'
|
||||||
}
|
}
|
||||||
if (content_type === null) {
|
if (content_type === null) {
|
||||||
core.setFailed(`Unexpected event name "${github.event.name}".`)
|
core.setFailed(`Unexpected event name "${github.event.name}".`)
|
||||||
}
|
}
|
||||||
|
|
||||||
await github.projects.createCard({
|
await github.projects.createCard({
|
||||||
column_id: column.id,
|
column_id: column.id,
|
||||||
//note:,
|
//note:,
|
||||||
content_id: context.issue.number,
|
content_id: context.issue.number,
|
||||||
content_type: content_type
|
content_type: content_type
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
await github.issues.update({
|
await github.issues.update({
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
|
|
||||||
})
|
})
|
||||||
*/
|
*/
|
Loading…
Reference in New Issue
Block a user