fix: SSH key corruption in deploy and wrong ldflags package path - #1
Conversation
|
@copilot resolve the merge conflicts in this pull request |
Merge conflicts resolved in commit |
There was a problem hiding this comment.
Pull request overview
This PR fixes a CI deploy failure caused by SSH key formatting issues (CRLF/\r in the secret) and corrects Go build metadata injection so gitHash/buildTime are properly embedded into the produced binary.
Changes:
- Harden SSH key materialization in the deploy script by stripping
\rbefore writingkey.pem. - Make
scp/sshfail fast on auth failures by disabling interactive/password fallback via SSH options. - Fix the
go build-ldflags -Xtargets so version variables in themainpackage are actually set, and clean up a deploy step label typo.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/deploy.yml | Fixes Go linker -X targets for version metadata injection and corrects the deploy step label. |
| .github/workflows/deploy.sh | Improves SSH key file creation (CR stripping) and tightens SSH/SCP auth behavior to fail fast. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The CI "build" job was failing at deploy with
Permission denied (publickey,password)— SSH key auth silently failed due to potential\rcorruption in the key file, then fell back to password auth which also fails. A secondary bug causedgitHash/buildTimeto never be injected into the binary.Changes
.github/workflows/deploy.sh— SSH key handling\rfrom the key before writing to disk (tr -d '\r') to handle Windows-style line endings in the GitHub Secret-o BatchMode=yes -o PasswordAuthentication=notoscp/sshto disable interactive password fallback and fail fast on key auth failure.github/workflows/deploy.yml—go buildldflagsgitHashandbuildTimeare package-level vars inmain(config_util.go), not in the non-existentinternal/globalpackage. Go silently ignores unknown-Xtargets, so the binary was always built with empty version info.