Skip to content

Commit

Permalink
feat: get body of new issue
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Sep 17, 2020
1 parent 0c2eb66 commit e6d9a84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion actions/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function run(): Promise<void> {
const eventType = context.payload.action;
if (eventType === 'opened') {
core.info(`[INFO] event type: ${eventType}`);
suggest(inps, 'Hello GitHub Actions');
suggest(inps);
} else if (eventType === 'edited') {
core.warning(`[WARN] ${eventType} event type is not supported`);
} else {
Expand Down
7 changes: 5 additions & 2 deletions actions/src/suggest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {GitHubAPI} from './github-api';
import {Inputs} from './interfaces';
import {context} from '@actions/github/lib/utils';
import {md2text, removeSymbols} from './preprocess';

export async function suggest(inps: Inputs, body: string): Promise<void> {
export async function suggest(inps: Inputs): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const body: string = (context.issue as any).body;
const githubAPI = new GitHubAPI(inps.GithubToken, context.repo.owner, context.repo.repo);
githubAPI.createComment(body);
githubAPI.createComment(removeSymbols(md2text(body)));
}

0 comments on commit e6d9a84

Please sign in to comment.