From 3356fe58aad7dbb7d5f0f3c9b9c2627a7b2a1bf5 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 16 Dec 2021 12:49:06 +0100 Subject: [PATCH] fix --- .github/workflows/assign-to-project.yml | 95 +++++++++++++------------ 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/.github/workflows/assign-to-project.yml b/.github/workflows/assign-to-project.yml index 718e8b3..4449469 100644 --- a/.github/workflows/assign-to-project.yml +++ b/.github/workflows/assign-to-project.yml @@ -15,51 +15,52 @@ jobs: steps: - name: Assign uses: actions/github-script@v4 - script: | - //const project_id = 2 - //const column_name = 'Drafting' - - const project_id = 1 - const column_name = 'To do' - - // find the column - const columns = github.projects.listColumns({ - project_id: project_id - }) - var column = null - for (const c of columns) { - if (c.name === column_name) { - column = c - } - } - if (c === null) { - core.setFailed(`Failed to find column "${column_name}" in project ${project_id}.`) - return - } - - var content_type = null - if (github.event.name === 'issue') { - content_type = 'Issue' - } - if (github.event.name === 'pull_request') { - content_type = 'PullRequest' - } - if (content_type === null) { - core.setFailed(`Unexpected event name "${github.event.name}".`) - } - - await github.projects.createCard({ - column_id: column.id, - //note:, - content_id: context.issue.number, - content_type: content_type - }) - - /* - await github.issues.update({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, + with: + script: | + //const project_id = 2 + //const column_name = 'Drafting' - }) - */ \ No newline at end of file + const project_id = 1 + const column_name = 'To do' + + // find the column + const columns = github.projects.listColumns({ + project_id: project_id + }) + var column = null + for (const c of columns) { + if (c.name === column_name) { + column = c + } + } + if (c === null) { + core.setFailed(`Failed to find column "${column_name}" in project ${project_id}.`) + return + } + + var content_type = null + if (github.event.name === 'issue') { + content_type = 'Issue' + } + if (github.event.name === 'pull_request') { + content_type = 'PullRequest' + } + if (content_type === null) { + core.setFailed(`Unexpected event name "${github.event.name}".`) + } + + await github.projects.createCard({ + column_id: column.id, + //note:, + content_id: context.issue.number, + content_type: content_type + }) + + /* + await github.issues.update({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + + }) + */ \ No newline at end of file