Skip to main content

github.github.createissuecomment

Home > @runlightyear/github > GitHub > createIssueComment

GitHub.createIssueComment() method

Create an issue comment

Signature:
createIssueComment(props: CreateIssueCommentProps): Promise<CreateIssueCommentResponse>;

Parameters

ParameterTypeDescription
propsCreateIssueCommentProps
Returns:

Promise<CreateIssueCommentResponse>

Example

Create an issue comment

import { defineAction } from "@runlightyear/lightyear";
import { GitHub } from "@runlightyear/github";

defineAction({
name: "createIssueComment",
title: "Create Issue Comment",
apps: ["github"],
variables: [
{
name: "owner",
description:
"The account owner of the repository. The name is not case sensitive.",
},
{
name: "repo",
description:
"The name of the repository without the .git extension. The name is not case sensitive.",
},
"issueNumber",
"comment",
],
run: async ({ auths, variables }) => {
const github = new GitHub({
auth: auths.github,
});
const response = await github.createIssueComment({
owner: variables.owner!,
repo: variables.repo!,
issueNumber: parseInt(variables.issueNumber!),
body: variables.comment!,
});
console.log("Response: ", response.data);
},
});