with dry-run mode (#42)
Co-authored-by: kjuulh <contact@kjuulh.io> Reviewed-on: #42
This commit is contained in:
@@ -21,7 +21,13 @@ impl GitSelector {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn run(&self, git: &Git, action_path: &PathBuf, action: &Action) -> eyre::Result<()> {
|
||||
pub async fn run(
|
||||
&self,
|
||||
git: &Git,
|
||||
action_path: &PathBuf,
|
||||
action: &Action,
|
||||
dryrun: bool,
|
||||
) -> eyre::Result<()> {
|
||||
tracing::info!("fetching repos");
|
||||
for repo in &git.repositories {
|
||||
let gp = self.git_provider.clone();
|
||||
@@ -36,6 +42,10 @@ impl GitSelector {
|
||||
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
self.git_provider
|
||||
.push_branch(repo, &push.branch.name)
|
||||
|
@@ -32,6 +32,7 @@ impl GiteaSelector {
|
||||
git: &Gitea,
|
||||
action_path: &PathBuf,
|
||||
action: &Action,
|
||||
dryrun: bool,
|
||||
) -> eyre::Result<()> {
|
||||
tracing::info!("fetching repos");
|
||||
for repo in &git.repositories {
|
||||
@@ -47,6 +48,10 @@ impl GiteaSelector {
|
||||
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
self.git_provider
|
||||
.push_branch(repo, &push.pull_request.name)
|
||||
|
@@ -32,6 +32,7 @@ impl GitHubSelector {
|
||||
git: &GitHub,
|
||||
action_path: &PathBuf,
|
||||
action: &Action,
|
||||
dryrun: bool,
|
||||
) -> eyre::Result<()> {
|
||||
tracing::info!("fetching repos");
|
||||
for repo in &git.repositories {
|
||||
@@ -47,6 +48,10 @@ impl GitHubSelector {
|
||||
|
||||
self.executor.execute(&path, action_path, action).await?;
|
||||
|
||||
if dryrun {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(push) = &git.push {
|
||||
self.git_provider
|
||||
.push_branch(repo, &push.pull_request.name)
|
||||
|
Reference in New Issue
Block a user