File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ export default defineConfig(
1919 eslintConfigPrettier ,
2020 {
2121 rules : {
22+ curly : "error" ,
23+
24+ /* eslint-plugin-unicorn */
2225 "unicorn/template-indent" : "error" ,
2326
2427 /* eslint-plugin-simple-import-sort */
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import path from "node:path" ;
2+ import * as github from "@actions/github" ;
23import { IS_TRIGGERED_BY_GITHUB_ISSUE_COMMENT } from "./constants.ts" ;
34import { reportsDirectory , THROW_EXECUTE_ERROR } from "./constants.ts" ;
45import { executeCommand } from "./execute-command.ts" ;
5- import { getIssueComment } from "./get-issue-comment.ts" ;
66import * as logger from "./logger.ts" ;
77import { getReport , stringifyReport } from "./report.ts" ;
88import { reportOnGithubIssue } from "./report-on-github-issue.ts" ;
@@ -11,14 +11,17 @@ import { writeFile } from "./utilities.ts";
1111async function run ( ) {
1212 let commandString ;
1313 if ( IS_TRIGGERED_BY_GITHUB_ISSUE_COMMENT ) {
14- const comment = getIssueComment ( ) ;
15- commandString = comment . body as string ;
14+ const { comment } = github . context . payload ;
15+ if ( ! comment ) {
16+ throw new Error ( "'github.context.payload.comment' is missing." ) ;
17+ }
18+ commandString = comment . body ;
1619 } else {
1720 commandString = process . argv . splice ( 2 ) [ 0 ] ;
1821 }
1922
20- if ( ! commandString ) {
21- throw new Error ( "Please enter some commands ." ) ;
23+ if ( typeof commandString !== "string" || ! commandString ) {
24+ throw new Error ( "Missing required command string ." ) ;
2225 }
2326
2427 await logger . brief (
You can’t perform that action at this time.
0 commit comments