Skip to content
This repository was archived by the owner on Sep 1, 2019. It is now read-only.

Commit

Permalink
last try createcard
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Page committed Apr 14, 2019
1 parent ca46464 commit 651ab80
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Toolkit.run( async ( tools ) => {

// Get the data from the event
const issue = tools.context.payload.issue;
tools.log( tools.context.payload )

// Get the project ID from the name
const { resource } = await tools.github.graphql(`query {
Expand Down Expand Up @@ -68,13 +67,17 @@ Toolkit.run( async ( tools ) => {
// Add the cards to the columns
const createCards = columns.map( column => {
return new Promise( async( resolve, reject ) => {
tools.log( issue.id, column.id );
try {
await tools.github.graphql(`mutation {
addProjectCard( input: { contentId: "${ issue.id }", projectColumnId: "${ column.id }" }) {
clientMutationId
}
}`);
await tools.github.projects.createCard({
column_id: column.id,
content_id: issue.node_id,
content_type: "Issue"
});
// await tools.github.graphql(`mutation {
// addProjectCard( input: { contentId: "${ issue.node_id }", projectColumnId: "${ column.id }" }) {
// clientMutationId
// }
// }`);

resolve();
}
Expand Down

0 comments on commit 651ab80

Please sign in to comment.