pantheon-systems / pantheon-systems/terminus-github-actions
curl download of terminus.phar silently saves HTTP error pages as the binary
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 18
- Forks
- 13
- Avg merge
- 22h 4m
- Merged PRs (30d)
- 2
Description
When multiple CI jobs use this action in parallel, the GitHub Releases CDN can occasionally return a 504 Gateway Time-out HTML page instead of terminus.phar. Because the curl command uses -L without --fail, the HTML error page is silently saved as the terminus binary. Every subsequent terminus command then fails with:
/usr/local/bin/terminus: line 1: syntax error near unexpected token `<'
/usr/local/bin/terminus: line 1: `<html><body><h1>504 Gateway Time-out</h1>'
This is particularly hard to diagnose because the error looks like a terminus/auth problem, not a download problem.
Steps to reproduce (sometimes):
- Create a workflow with 10+ parallel jobs that each call pantheon-systems/terminus-github-actions@v1
- Run the workflow — some jobs will intermittently get a 504 from the GitHub Releases CDN
- Those jobs save the HTML error page as ~/terminus/terminus and all terminus commands fail
Suggested fixes (in order of impact):
- Add --fail to curl — this is the critical fix. Change curl -L to curl -fL so HTTP errors cause curl to exit non-zero instead of silently saving the error page. The step will fail immediately with a clear message.
- Add
--retry:curl -fL --retry 3 --retry-delay 5would handle transient CDN issues automatically. - Cache the binary by version — the phar never changes for a given release version. Caching ~/terminus with a key like terminus-bin-${{ input.terminus-version }} would eliminate redundant downloads entirely, which also reduces load on GitHub's CDN when many parallel jobs run.
- Skip download if binary exists — if ~/terminus/terminus already exists and reports the expected version, skip the download. This helps workflows that call the action multiple times or have a pre-cached binary. (This would allow consumers of this action to do the binary caching and still use
setup-terminusfor the authentication caching).
Environment:
Action version: v1 (SHA 8e024bd89ff46ed2aa4e0663c6b54c87a94344f8)
Terminus version requested: 4.1.6
Runner: ubuntu-latest
Parallel jobs in workflow: ~15
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the setup action's curl -L command that downloads ~/terminus/terminus for the requested Terminus version. Verify the download step handles HTTP failures instead of saving an HTML error page, then exercise the action's download path with a failing response and confirm the workflow reports the download error clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, shell
- Domain
- ci-cd, cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100