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:
Gokul
2025-08-21 15:17:26 +05:30
committed by GitHub

View File

@@ -804,13 +804,6 @@ async fn execute_job(ctx: JobExecutionContext<'_>) -> Result<JobResult, Executio
ExecutionError::Execution(format!("Failed to get current directory: {}", e)) 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(&current_dir, job_dir.path())?;
wrkflw_logging::info(&format!("Executing job: {}", ctx.job_name)); wrkflw_logging::info(&format!("Executing job: {}", ctx.job_name));
let mut job_success = true; let mut job_success = true;
@@ -1010,13 +1003,6 @@ async fn execute_matrix_job(
ExecutionError::Execution(format!("Failed to get current directory: {}", e)) 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(&current_dir, job_dir.path())?;
let job_success = if job_template.steps.is_empty() { let job_success = if job_template.steps.is_empty() {
wrkflw_logging::warning(&format!("Job '{}' has no steps", matrix_job_name)); wrkflw_logging::warning(&format!("Job '{}' has no steps", matrix_job_name));
true true
@@ -1806,6 +1792,7 @@ fn copy_directory_contents(from: &Path, to: &Path) -> Result<(), ExecutionError>
let entry = let entry =
entry.map_err(|e| ExecutionError::Execution(format!("Failed to read entry: {}", e)))?; entry.map_err(|e| ExecutionError::Execution(format!("Failed to read entry: {}", e)))?;
let path = entry.path(); let path = entry.path();
wrkflw_logging::debug(&format!("Copying entry: {path:?} -> {to:?}"));
// Skip hidden files/dirs and target directory for efficiency // Skip hidden files/dirs and target directory for efficiency
let file_name = match path.file_name() { let file_name = match path.file_name() {