feat(ci): use $RUNNER_TEMP instead of /tmp in claude-fix workflow #44

Merged
nrupard merged 2 commits from feat/pms-132-no-tmp into main 2026-05-27 17:20:45 +02:00
Owner

Closes PMS-132.

The claude-fix workflow wrote three scratch files to hardcoded /tmp paths: claude-context/CONTEXT.md, claude-result.json, and commit-message.txt. This switches 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 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_FILE before 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 (tempfile crate in tests / src/infisical/dev.rs, mktemp --tmpdir in the justfile) honors $TMPDIR and uses random unique names, so it is out of scope for this change.

Closes PMS-132. The `claude-fix` workflow wrote three scratch files to hardcoded `/tmp` paths: `claude-context/CONTEXT.md`, `claude-result.json`, and `commit-message.txt`. This switches 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 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_FILE` before 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 (`tempfile` crate in tests / `src/infisical/dev.rs`, `mktemp --tmpdir` in the justfile) honors `$TMPDIR` and uses random unique names, so it is out of scope for this change.
feat(ci): use $RUNNER_TEMP instead of /tmp in claude-fix workflow
Some checks failed
Check / fmt + clippy + compile + tests (pull_request) Has been cancelled
54f194189a
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>
feat(ci): guard against unset RUNNER_TEMP before using it
All checks were successful
Check / fmt + clippy + compile + tests (pull_request) Successful in 28s
Create release / Create release from merged PR (pull_request) Has been skipped
bcd0990be9
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>
nrupard deleted branch feat/pms-132-no-tmp 2026-05-27 17:20:45 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!44
No description provided.