From bc9b17a665bcb85d1da792a488b6492b95aa63f4 Mon Sep 17 00:00:00 2001 From: weichen Date: Wed, 14 Oct 2026 16:24:12 +0000 Subject: [PATCH] Register CI secret cleanup before writing the key Why: An early filesystem failure could exit before the UI deploy key cleanup trap existed. Evidence: Parsed workflow confirms the EXIT trap precedes the first secret write. Impact: Normal checkout failures remove both transient credential files from the runner. Refs: IAM U3 Frontend PR #86 --- .gitea/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2028e0f..8515323 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -35,9 +35,9 @@ jobs: git checkout -q --detach FETCH_HEAD test "$(git rev-parse HEAD)" = "${GITHUB_SHA}" umask 077 + trap 'rm -f "${RUNNER_TEMP}/iam-frontend-ci/ui_deploy_key" "${RUNNER_TEMP}/iam-frontend-ci/ui_known_hosts"' EXIT printf '%s' "${UI_DEPLOY_KEY}" > "${RUNNER_TEMP}/iam-frontend-ci/ui_deploy_key" printf '%s\n' '[git-ssh.u1680832.nyat.app]:31411 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK55QSxDqMMZ1HIWHSPkQ7fyJkDKbdg98TeIv6SrR3qx' > "${RUNNER_TEMP}/iam-frontend-ci/ui_known_hosts" - trap 'rm -f "${RUNNER_TEMP}/iam-frontend-ci/ui_deploy_key" "${RUNNER_TEMP}/iam-frontend-ci/ui_known_hosts"' EXIT export GIT_SSH_COMMAND="ssh -F /dev/null -i ${RUNNER_TEMP}/iam-frontend-ci/ui_deploy_key -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=${RUNNER_TEMP}/iam-frontend-ci/ui_known_hosts -p 31411" cd "${RUNNER_TEMP}/iam-frontend-ci/ui" git init -q