feat(ci): use $RUNNER_TEMP instead of /tmp in claude-fix workflow #44
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-132-no-tmp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes PMS-132.
The
claude-fixworkflow wrote three scratch files to hardcoded/tmppaths:claude-context/CONTEXT.md,claude-result.json, andcommit-message.txt. This switches all of them to the job-scoped${RUNNER_TEMP}directory that the Forgejo runner provides.RUNNER_TEMPis constant across steps within a job, so the context file written in the "Build failure context" step is still readable in the "Run Claude Code" step, and the runner cleans it up per job instead of leaving artifacts in a shared/tmp.The "Run Claude Code" prompt heredoc was single-quoted and therefore could not expand a shell variable. It now resolves
CONTEXT_FILEbefore an unquoted heredoc; the prompt body contains no other shell metacharacters, so unquoting is safe.No other workflow or runtime code uses hardcoded
/tmp. The remaining temp usage in the tree (tempfilecrate in tests /src/infisical/dev.rs,mktemp --tmpdirin the justfile) honors$TMPDIRand uses random unique names, so it is out of scope for this change.PMS-132. The claude-fix workflow wrote scratch files (claude-context/CONTEXT.md, claude-result.json, commit-message.txt) to hardcoded /tmp paths. Switch all of them to the job-scoped ${RUNNER_TEMP} directory that the Forgejo runner provides. RUNNER_TEMP is constant across steps within a job, so the context file written in one step is still readable in later steps, and it is cleaned up automatically per job rather than persisting in a shared /tmp. The Run Claude Code step's prompt heredoc was single-quoted, so it could not expand a shell variable; it now resolves CONTEXT_FILE before an unquoted heredoc (the prompt body contains no other shell metacharacters). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Add `: "${RUNNER_TEMP:?...}"` at the top of the three run blocks that dereference RUNNER_TEMP. If the runner ever fails to set it, the step now fails fast with a clear message instead of silently writing scratch files to the container filesystem root. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>