Skip to content

Commit

Permalink
Mark invalid external repo specifiers as configuration error
Browse files Browse the repository at this point in the history
This is a workaround — the proper fix is to better separate out user input vs the Action in `database init` so we can better attribute configuration errors.
  • Loading branch information
henrymercer committed Jan 10, 2025
1 parent 87fc816 commit fe593c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/cli-errors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/cli-errors.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/cli-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export enum CliConfigErrorCategory {
IncompatibleWithActionVersion = "IncompatibleWithActionVersion",
InitCalledTwice = "InitCalledTwice",
InvalidConfigFile = "InvalidConfigFile",
InvalidExternalRepoSpecifier = "InvalidExternalRepoSpecifier",
InvalidSourceRoot = "InvalidSourceRoot",
MavenBuildFailed = "MavenBuildFailed",
NoBuildCommandAutodetected = "NoBuildCommandAutodetected",
Expand Down Expand Up @@ -188,6 +189,11 @@ export const cliErrorsConfig: Record<
new RegExp("The supplied config file is empty"),
],
},
[CliConfigErrorCategory.InvalidExternalRepoSpecifier]: {
cliErrorMessageCandidates: [
new RegExp("Specifier for external repository is invalid"),
],
},
// Expected source location for database creation does not exist
[CliConfigErrorCategory.InvalidSourceRoot]: {
cliErrorMessageCandidates: [new RegExp("Invalid source root")],
Expand Down

0 comments on commit fe593c3

Please sign in to comment.