File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47460,16 +47460,19 @@ var configSchema = object({
4746047460 "perennial-regex": string3().optional()
4746147461 }).optional()
4746247462});
47463+ var CONFIG_FILE_NAMES = [".git-branches.toml", ".git-town.toml"];
4746347464var configFile;
47464- try {
47465- configFile = fs.readFileSync(".git-branches.toml").toString();
47466- } catch {
47467- configFile = void 0;
47468- }
47465+ CONFIG_FILE_NAMES.forEach((file) => {
47466+ try {
47467+ configFile ??= fs.readFileSync(file).toString();
47468+ } catch {
47469+ configFile = void 0;
47470+ }
47471+ });
4746947472var parsed = configSchema.safeParse(toml.parse(configFile ?? ""));
4747047473if (!parsed.success) {
4747147474 core3.warning(
47472- "Failed to parse Git Town config. If this is a mistake, ensure that `.git-branches.toml` is valid."
47475+ "Failed to parse Git Town config. If this is a mistake, ensure that `.git-branches.toml`/`.git-town.toml` is valid."
4747347476 );
4747447477}
4747547478var config = configFile && parsed.success ? parsed.data : void 0;
Original file line number Diff line number Diff line change @@ -15,19 +15,22 @@ const configSchema = object({
1515
1616export type Config = z . infer < typeof configSchema >
1717
18- let configFile
19-
20- try {
21- configFile = fs . readFileSync ( '.git-branches.toml' ) . toString ( )
22- } catch {
23- configFile = undefined
24- }
18+ const CONFIG_FILE_NAMES = [ '.git-branches.toml' , '.git-town.toml' ]
19+ let configFile : string | undefined
20+
21+ CONFIG_FILE_NAMES . forEach ( ( file ) => {
22+ try {
23+ configFile ??= fs . readFileSync ( file ) . toString ( )
24+ } catch {
25+ configFile = undefined
26+ }
27+ } )
2528
2629const parsed = configSchema . safeParse ( toml . parse ( configFile ?? '' ) )
2730
2831if ( ! parsed . success ) {
2932 core . warning (
30- 'Failed to parse Git Town config. If this is a mistake, ensure that `.git-branches.toml` is valid.'
33+ 'Failed to parse Git Town config. If this is a mistake, ensure that `.git-branches.toml`/`.git-town.toml` is valid.'
3134 )
3235}
3336
You can’t perform that action at this time.
0 commit comments