Skip to content

Commit

Permalink
Better naming for GitHub commit status option and config param.
Browse files Browse the repository at this point in the history
  • Loading branch information
bittrance committed Nov 5, 2023
1 parent b448dbf commit 50f3fb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ pub struct CliOptions {
/// GitHub App private key file
#[clap(long)]
pub github_private_key_file: Option<PathBuf>,
/// Turn on updating GitHub commit status with this context (requires auth flags)
/// Turn on updating GitHub commit status updates with this context (requires auth flags)
#[clap(long)]
pub github_context: Option<String>,
pub github_status_context: Option<String>,
/// Check repo for changes at this interval (e.g. 1h, 30m, 10s)
#[arg(long, value_parser = humantime::parse_duration)]
pub interval: Option<Duration>,
Expand Down Expand Up @@ -106,7 +106,7 @@ fn into_task(mut config: GitTaskConfig, opts: &CliOptions) -> ScheduledTask<GitW
}
let mut work = GitWorkload::from_config(config, opts);
if let Some(github) = github {
if github.notify_context.is_some() {
if github.status_context.is_some() {
work.watch(github_watcher(slug.unwrap(), github));
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/task/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct GithubConfig {
app_id: String,
private_key_file: PathBuf,
#[serde(default = "GithubConfig::default_context")]
pub notify_context: Option<String>,
pub status_context: Option<String>,
}

impl GithubConfig {
Expand All @@ -39,7 +39,7 @@ impl TryFrom<&CliOptions> for Option<GithubConfig> {
(Some(app_id), Some(private_key_file)) => Ok(Some(GithubConfig {
app_id: app_id.clone(),
private_key_file: private_key_file.clone(),
notify_context: opts.github_context.clone(),
status_context: opts.github_status_context.clone(),
})),
_ => Err(GitOpsError::InvalidNotifyConfig),
}
Expand Down Expand Up @@ -202,7 +202,7 @@ pub fn update_commit_status(
);
let body = serde_json::json!({
"state": status,
"context": config.notify_context.unwrap(),
"context": config.status_context.unwrap(),
"description": message,
});
let res = client
Expand Down

0 comments on commit 50f3fb8

Please sign in to comment.