Compare commits

...

3 Commits

Author SHA1 Message Date
Nikola Jokic
801a447f60 Update packages/k8s/src/hooks/run-script-step.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-08 12:50:34 +01:00
Nikola Jokic
fe1fa3ed2d Update packages/k8s/src/hooks/run-script-step.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-08 12:15:36 +01:00
Nikola Jokic
cdec7f075f remove _temp_pre 2025-12-08 11:52:07 +01:00

View File

@@ -27,21 +27,15 @@ export async function runScriptStep(
const containerTemp = '/__w/_temp'
const containerTempSrc = '/__w/_temp_pre'
// Ensure base and staging dirs exist before copying
try {
await execPodStep(
[
'sh',
'-c',
'mkdir -p /__w && mkdir -p /__w/_temp && mkdir -p /__w/_temp_pre'
],
state.jobPod,
JOB_CONTAINER_NAME
)
} catch (err) {
core.debug(
`Failed to create temp dirs in container: ${JSON.stringify(err)}`
)
}
await execPodStep(
[
'sh',
'-c',
'mkdir -p /__w && mkdir -p /__w/_temp && mkdir -p /__w/_temp_pre'
],
state.jobPod,
JOB_CONTAINER_NAME
)
await execCpToPod(state.jobPod, runnerTemp, containerTempSrc)
// Copy GitHub directories from temp to /github
@@ -56,7 +50,9 @@ export async function runScriptStep(
// Overwrite _runner_file_commands
'[ -d "$SRC/_runner_file_commands" ] && mkdir -p "$DST/_runner_file_commands" && cp -a "$SRC/_runner_file_commands/." "$DST/_runner_file_commands/" || true',
// Append other files if missing
'find "$SRC" -type f ! -path "*/_runner_file_commands/*" | while read -r f; do rel=${f#"$SRC/"}; target="$DST/$rel"; dir=$(dirname "$target"); if [ ! -e "$target" ]; then mkdir -p "$dir"; cp -a "$f" "$target"; fi; done'
'find "$SRC" -type f ! -path "*/_runner_file_commands/*" -exec sh -c '\''rel="${1#$2/}"; target="$3/$rel"; dir=$(dirname "$target"); if [ ! -e "$target" ]; then mkdir -p "$dir" && cp -a "$1" "$target"; fi'\'' _ {} "$SRC" "$DST" \;',
// Remove _temp_pre after merging
'rm -rf /__w/_temp_pre'
]
try {