fix(ci): remove TTY hack from publish workflow #222
Loading…
Reference in a new issue
No description provided.
Delete branch "worktree-cosmic-sniffing-hare"
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?
Summary
Removes the
rm -f /dev/ttyworkaround from the publish workflow that was added to preventinstall.shfrom hanging on the interactive SWAMP CLUB login prompt during CI runs.Problem
The publish job intermittently failed because the TTY hack (
rm -f /dev/tty) requires permissions that Forgejo runners may or may not have. When the runner couldn't remove the device node,install.shwould detect a TTY via[ -e /dev/tty ] && [ -t 1 ]and block waiting for user input on the SWAMP CLUB signup prompt, hanging the job until timeout.The flakiness came from the fact that
/dev/ttyexists as a kernel device node on most Linux systems regardless of whether a real terminal is attached — sorm -f /dev/ttywas racing against runner permissions and device allocation.Fix
The upstream
install.shnow checks for theCIenvironment variable before attempting TTY detection, and skips the interactive prompt entirely when it's set. See swamp-club/swamp#2242.Since Forgejo Actions (like all major CI systems) sets
CI=trueautomatically, the install script will skip the prompt without any workaround needed on the consumer side.Impact
rm -f /dev/ttywas the only thing attempting to suppress itCo-authored-by: Paul Stack paul@swamp-club.com
Code Review
Blocking Issues
None.
Suggestions
None.
Summary: This PR removes the
rm -f /dev/ttystep that was added as a workaround to suppress interactive prompts from theswampCLI. The fix is correct and clean:swamp extension push manifest.yaml --yesalready passes--yes, which is the proper way to opt into non-interactive mode.swamp repo init --quiet --tool nonealready passes--quietfor the same reason.Destroying
/dev/ttyis an aggressive and side-effect-prone hack (it affects every process in the runner for the rest of the job). Using the CLI's own flags is the right approach. The removal is safe.No security, correctness, or compliance issues found.
CI Security Review
File reviewed:
.forgejo/workflows/publish.ymlChange summary: Removes a
rm -f /dev/ttystep ("Disable TTY to prevent interactive prompts") from thepublishjob. No other changes.Checklist
run:blocks.${{ toJson(matrix.chunk) }}is safely passed viaenv:, not inline.${{ strategy.job-index }}in the job name is a safe numeric value.pushtomainonly — requires repo write accessactions/checkout@v6(GitHub-owned, trusted) andsysteminit/setup-swamp@v0.1.0(trusted publisher per policy)contents: readset at both workflow-level (line 8) and job-level (lines 19, 55). Minimum necessary for checkout + publish. Noid-token: writeorcontents: write.SWAMP_API_KEYis passed only tosetup-swampviawith:, the standard pattern. Not interpolated inrun:blocks.Verdict
PASS — The change removes an unnecessary
rm -f /dev/ttyhack, which is a minor cleanup with no security impact. The overall workflow has sound security posture: minimal permissions, safe expression handling, trusted action pins, and secrets properly scoped.