@@ -33,7 +33,6 @@ import {
3333} from "./pullRequestKey.js" ;
3434import { ISMTPOptions } from "./send-mail.js" ;
3535import { fileURLToPath } from "url" ;
36- import defaultConfig from "./gitgitgadget-config.js" ;
3736
3837const readFile = util . promisify ( fs . readFile ) ;
3938type CommentFunction = ( comment : string ) => Promise < void > ;
@@ -65,11 +64,12 @@ export class CIHelper {
6564
6665 public static validateConfig = typia . createValidate < IConfig > ( ) ;
6766
68- public static getConfigAsGitHubActionInput ( ) : IConfig | undefined {
69- if ( process . env . GITHUB_ACTIONS !== "true" ) return undefined ;
67+ public static getConfigAsGitHubActionInput ( ) : IConfig {
68+ if ( process . env . GITHUB_ACTIONS !== "true" ) throw new Error ( `Need a config!` ) ;
7069 const json = core . getInput ( "config" ) ;
71- if ( ! json ) return undefined ;
70+ if ( ! json ) throw new Error ( `Need a config!` ) ;
7271 const config = JSON . parse ( json ) as IConfig | undefined ;
72+ if ( ! config ) throw new Error ( `Need a config!` ) ;
7373 const result = CIHelper . validateConfig ( config ) ;
7474 if ( result . success ) return config ;
7575 throw new Error (
@@ -80,7 +80,7 @@ export class CIHelper {
8080 }
8181
8282 public constructor ( workDir : string = "pr-repo.git" , config ?: IConfig , skipUpdate ?: boolean , gggConfigDir = "." ) {
83- this . config = config || CIHelper . getConfigAsGitHubActionInput ( ) || defaultConfig ;
83+ this . config = config || CIHelper . getConfigAsGitHubActionInput ( ) ;
8484 this . gggConfigDir = gggConfigDir ;
8585 this . workDir = workDir ;
8686 this . notes = new GitNotes ( workDir ) ;
0 commit comments