Skip to content

Commit 6fd8d01

Browse files
committed
Merge branch 'retire-misc-helper-and-defaultConfig'
Various cleanups, some of them long overdue. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 parents 7da7e08 + 001c619 commit 6fd8d01

14 files changed

+181
-985
lines changed

lib/ci-helper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {
3333
} from "./pullRequestKey.js";
3434
import { ISMTPOptions } from "./send-mail.js";
3535
import { fileURLToPath } from "url";
36-
import defaultConfig from "./gitgitgadget-config.js";
3736

3837
const readFile = util.promisify(fs.readFile);
3938
type 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);

lib/gitgitgadget-config.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

lib/patch-series-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface IPatchSeriesMetadata {
2-
readonly pullRequestURL?: string;
2+
readonly pullRequestURL: string;
33
baseCommit: string;
44
baseLabel: string;
55
headCommit: string;

0 commit comments

Comments
 (0)