async function createIssueCard(octokit) {
    console.log("createIssueCard");
    // Trigger: issue opened
    // issue context
    // https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
    // github.context.event is the webhook payload, in this case the issues event payload
    // https://developer.github.com/v3/activity/events/types/#issuesevent

    // Cribbing from github-actions-automate-projects
    // https://github.com/takanabe/github-actions-automate-projects/blob/master/main.go

    // Find ID of column to put card in, using projectURL and requestColumn action inputs.    
    var colID = await getColumnIDByName(octokit, 'requestColumn');
    if (colID == 0) {
        throw "Column not found.";
    }

    // Create project card from issue
    // https://developer.github.com/v3/projects/cards/#create-a-project-card
    // https://octokit.github.io/rest.js/v17#projects-create-card
    var resp = await octokit.projects.createCard({
        column_id: colID,
        content_id: github.context.payload.issue.id,
        content_type: 'Issue',
    });
    console.log(resp.status); // TODO proper check
    // resp.data.content_url == url of associated issue
    // e.g. content_url: 'https://api.github.com/repos/nostarch-foundation/grant-actions/issues/8'
}
// When a new issue is opened, automatically add it to a GitHub project to facilitate review.
When a new issue is opened, automatically add it to a GitHub project to facilitate review.
When a new issue is opened automatically add it to a GitHub project to facilitate review .
async function createIssueCard(octokit) {
    console.log("createIssueCard");
    var colID = await getColumnIDByName(octokit, 'requestColumn');
    if (colID == 0) {
        throw "Column not found.";
    }
    var resp = await octokit.projects.createCard({
        column_id: colID,
        content_id: github.context.payload.issue.id,
        content_type: 'Issue',
    });
    console.log(resp.status); 
}
async function createIssueCard ( octokit ) { console . log ( "createIssueCard" ) ; var colID = await getColumnIDByName ( octokit , 'requestColumn' ) ; if ( colID == 0 ) { throw "Column not found." ; } var resp = await octokit . projects . createCard ( { column_id : colID , content_id : github . context . payload . issue . id , content_type : 'Issue' , } ) ; console . log ( resp . status ) ; }
When a new issue is opened, automatically add it to a GitHub project to facilitate review.
When a new issue is opened automatically add it to a GitHub project to facilitate review .
// Trigger: issue opened // issue context // https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions // github.context.event is the webhook payload, in this case the issues event payload // https://developer.github.com/v3/activity/events/types/#issuesevent // Cribbing from github-actions-automate-projects // https://github.com/takanabe/github-actions-automate-projects/blob/master/main.go // Find ID of column to put card in, using projectURL and requestColumn action inputs.     // Create project card from issue // https://developer.github.com/v3/projects/cards/#create-a-project-card // https://octokit.github.io/rest.js/v17#projects-create-card // TODO proper check // resp.data.content_url == url of associated issue // e.g. content_url: 'https://api.github.com/repos/nostarch-foundation/grant-actions/issues/8'