From 9839b8b034e7a56356c2ba44eb6281b8115152a6 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sun, 25 Feb 2024 00:15:11 +0100 Subject: [PATCH] fix yaml parser --- src/config/cli.rs | 2 ++ src/config/mod.rs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config/cli.rs b/src/config/cli.rs index 1f977a7..6b26337 100644 --- a/src/config/cli.rs +++ b/src/config/cli.rs @@ -62,9 +62,11 @@ pub enum Commands { message: Option>, /// generate and add a changelog + #[arg(short, long)] changelog: bool, /// publish after releasing + #[arg(short, long)] publish: bool, }, /// Publish to a package registry diff --git a/src/config/mod.rs b/src/config/mod.rs index b02f7c6..04d7132 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -50,12 +50,16 @@ impl YamlConfigSection for Uses { } #[derive(Debug, Clone, Deserialize)] +#[serde(rename_all = "snake_case")] pub enum Pass { /// pass specified as plainext + #[serde(alias = "pass_text")] Text(String), /// pass to be loaded from an env var + #[serde(alias = "pass_env")] Env(String), /// pass to be loaded from a file + #[serde(alias = "pass_file")] File(PathBuf), } impl Pass { @@ -102,13 +106,14 @@ impl YamlConfigSection for ApiAuth { #[derive(Debug, Clone, Deserialize)] pub struct Api { + #[serde(alias = "type")] pub server_type: ApiType, pub endpoint: Url, /// May be left empty if the Api does not need auth or the auth is part of the /// [endpoint](Api::endpoint) [Url]. pub auth: Option, /// Name of the repository on the Git server, as git itself has no concept of repository name - pub repository: String + pub repository: String, } impl YamlConfigSection for Api { fn check(&self) -> Result<()> {