Skip to content

Commit

Permalink
feat(triage-bot): start v2 impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Jan 8, 2025
1 parent e45098d commit e3bcac4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions scripts/triage-bot/src/triage-bot-v2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* eslint-disable @typescript-eslint/naming-convention */

/** @typedef {import('github-script').AsyncFunctionArguments} AsyncFunctionArguments */

/**
*
* @param {AsyncFunctionArguments} options
*/
async function main(options) {
const { context, github } = options;

const issueNumber = context.payload?.issue?.number;

if (!issueNumber) {
throw new Error('no issue number provided!');
}

const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
});

const issueMD = issue.data.body;

// 1. todo parse markdown
// 2. extract Component string `## Component > content`
// 3. assign Labels based on Component
// 4. assign code-owners based on Labels
console.log(issueMD);
}

module.exports = main;

0 comments on commit e3bcac4

Please sign in to comment.