Skip to content

Fix running steam-deploy more than once in the same job - #91

Merged
frostebite merged 1 commit into
mainfrom
fix-rerun
Aug 17, 2026
Merged

Fix running steam-deploy more than once in the same job#91
frostebite merged 1 commit into
mainfrom
fix-rerun

Conversation

@davidmfinol

@davidmfinol davidmfinol commented Aug 1, 2026

Copy link
Copy Markdown
Member

What

steam_deploy.sh created its temporary files — BuildOutput/, manifest.vdf, and depot*.vdf — directly in the workspace root. A second uses: of this action in the same job therefore died at:

mkdir: cannot create directory ‘BuildOutput’: File exists

Since the action runs in a container as root, those leftovers were also root-owned, which can break a subsequent actions/checkout on self-hosted runners.

How

  • All temporary files move to a per-run mktemp -d under $RUNNER_TEMP (falling back to /tmp). Every reference — the manifest's buildoutput, the depot vdf paths in DEPOTS, build_output.log, and the failure-path ls/cat of the build logs — now points at that directory.
  • An EXIT trap chown -Rs the temp dir to the workspace owner, so nothing root-owned is left for the runner to clean up.
  • The manifest output still points at the real manifest path, now inside the temp dir.

Test

Adds a regression step to .github/workflows/main.yml: the action runs a second time in the same job, followed by an assertion that the workspace has no unwritable files and no stray BuildOutput.

Fixes #79

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved deployment reliability when running the Steam deployment process multiple times in the same job.
    • Temporary deployment files are isolated and cleaned up automatically.
    • Prevented leftover build artifacts and permission issues in the workspace.
    • Deployment logs and build identifiers are now collected consistently from temporary files.

The action created BuildOutput/, manifest.vdf, and depot*.vdf in the
workspace root, so a second `uses:` of the action in the same job failed
with `mkdir: cannot create directory 'BuildOutput': File exists`. Because
the action runs in a container as root, those leftovers were also
root-owned and could break a later checkout on self-hosted runners.

Everything temporary now goes into a per-run mktemp dir under $RUNNER_TEMP,
and an EXIT trap chowns it back to the workspace owner. Adds a regression
test to the workflow that runs the action twice and asserts the workspace
is left clean and writable.

Fixes #79

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ce2bb01e-1459-4c27-b30e-26b3bc5ba3b4

📥 Commits

Reviewing files that changed from the base of the PR and between 42f7685 and c4d2531.

📒 Files selected for processing (2)
  • .github/workflows/main.yml
  • steam_deploy.sh

📝 Walkthrough

Walkthrough

The deployment script now stores manifests, build output, and logs in a unique temporary directory. The workflow runs deployment twice and verifies that the workspace remains writable and contains no BuildOutput directory.

Changes

Steam deployment isolation

Layer / File(s) Summary
Temporary deployment workspace
steam_deploy.sh
The script creates a temporary workspace, uses it for Steam manifests, build output, and logs, extracts the build ID from the temporary log, and restores file ownership on exit.
Repeated deployment regression test
.github/workflows/main.yml
The workflow runs the deployment action twice with the same inputs, then checks workspace file permissions and confirms that BuildOutput is absent.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHub Actions
  participant steam_deploy.sh
  participant SteamCMD
  GitHub Actions->>steam_deploy.sh: invoke deployment
  steam_deploy.sh->>steam_deploy.sh: create unique temporary workspace
  steam_deploy.sh->>SteamCMD: build with temporary app manifest
  SteamCMD-->>steam_deploy.sh: write build log and output
  steam_deploy.sh-->>GitHub Actions: return deployment result
  GitHub Actions->>steam_deploy.sh: invoke deployment again
  steam_deploy.sh->>SteamCMD: build using a new temporary workspace
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main fix: allowing repeated steam-deploy execution in one job.
Description check ✅ Passed The description explains the problem, implementation, regression test, and linked issue, but uses different headings than the template.
Linked Issues check ✅ Passed The changes address issue #79 by isolating temporary files and testing two deployments in the same CI job.
Out of Scope Changes check ✅ Passed The script and workflow changes are directly related to repeated deployment execution and workspace cleanup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-rerun

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@frostebite
frostebite merged commit 50f6b29 into main Aug 17, 2026
4 of 5 checks passed
@frostebite
frostebite deleted the fix-rerun branch August 17, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot execute steam-deploy twice in the same CI job

2 participants