mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2025-12-16 03:37:49 +01:00
Merge pull request #45 from anti-social/fix-double-repo-copying
Do not copy a repository before executing a job
This commit is contained in:
@@ -804,13 +804,6 @@ async fn execute_job(ctx: JobExecutionContext<'_>) -> Result<JobResult, Executio
|
||||
ExecutionError::Execution(format!("Failed to get current directory: {}", e))
|
||||
})?;
|
||||
|
||||
// Copy project files to the job workspace directory
|
||||
wrkflw_logging::info(&format!(
|
||||
"Copying project files to job workspace: {}",
|
||||
job_dir.path().display()
|
||||
));
|
||||
copy_directory_contents(¤t_dir, job_dir.path())?;
|
||||
|
||||
wrkflw_logging::info(&format!("Executing job: {}", ctx.job_name));
|
||||
|
||||
let mut job_success = true;
|
||||
@@ -1010,13 +1003,6 @@ async fn execute_matrix_job(
|
||||
ExecutionError::Execution(format!("Failed to get current directory: {}", e))
|
||||
})?;
|
||||
|
||||
// Copy project files to the job workspace directory
|
||||
wrkflw_logging::info(&format!(
|
||||
"Copying project files to job workspace: {}",
|
||||
job_dir.path().display()
|
||||
));
|
||||
copy_directory_contents(¤t_dir, job_dir.path())?;
|
||||
|
||||
let job_success = if job_template.steps.is_empty() {
|
||||
wrkflw_logging::warning(&format!("Job '{}' has no steps", matrix_job_name));
|
||||
true
|
||||
@@ -1806,6 +1792,7 @@ fn copy_directory_contents(from: &Path, to: &Path) -> Result<(), ExecutionError>
|
||||
let entry =
|
||||
entry.map_err(|e| ExecutionError::Execution(format!("Failed to read entry: {}", e)))?;
|
||||
let path = entry.path();
|
||||
wrkflw_logging::debug(&format!("Copying entry: {path:?} -> {to:?}"));
|
||||
|
||||
// Skip hidden files/dirs and target directory for efficiency
|
||||
let file_name = match path.file_name() {
|
||||
|
||||
Reference in New Issue
Block a user