Update SSH key setup in deploy workflow #18

Merged
rdenadai merged 1 commit from rdenadai-patch-8 into main 2025-10-18 18:56:13 +00:00
rdenadai commented 2025-10-18 18:56:07 +00:00 (Migrated from github.com)

Changed from printf to echo for setting up SSH key.

Changed from printf to echo for setting up SSH key.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-10-18 18:57:05 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR modifies the deploy workflow to switch from printf to echo when writing the SSH private key file and removes some inline comments.

  • Replace printf with echo for writing the SSH key
  • Remove explanatory comments around key formatting and validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

## Pull Request Overview This PR modifies the deploy workflow to switch from printf to echo when writing the SSH private key file and removes some inline comments. - Replace printf with echo for writing the SSH key - Remove explanatory comments around key formatting and validation --- <sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/rdenadai/web.redecapivara.social/new/main/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>
@ -36,10 +36,8 @@ jobs:
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-18 18:57:05 +00:00

After creating ~/.ssh, set directory permissions to 700 to prevent SSH from refusing the key due to permissive directory permissions. Add: chmod 700 ~/.ssh right after mkdir.

          mkdir -p ~/.ssh
          chmod 700 ~/.ssh
After creating ~/.ssh, set directory permissions to 700 to prevent SSH from refusing the key due to permissive directory permissions. Add: chmod 700 ~/.ssh right after mkdir. ```suggestion mkdir -p ~/.ssh chmod 700 ~/.ssh ```
@ -41,3 +39,3 @@
echo "${{ secrets.VM_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Verify key is valid
ssh-keygen -l -f ~/.ssh/id_rsa || { echo "Invalid SSH key"; exit 1; }
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-18 18:57:04 +00:00

Using echo to write a multi-line SSH private key is unreliable across shells and can alter formatting (e.g., extra trailing newline or escape handling), leading to an invalid key. Please revert to printf to preserve the exact content.

          printf '%s' "${{ secrets.VM_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
Using echo to write a multi-line SSH private key is unreliable across shells and can alter formatting (e.g., extra trailing newline or escape handling), leading to an invalid key. Please revert to printf to preserve the exact content. ```suggestion printf '%s' "${{ secrets.VM_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-10-18 18:57:05 +00:00

[nitpick] The removed comment explained why printf was used to preserve key formatting; keeping a brief rationale helps prevent regressions. Consider restoring a short comment (e.g., 'Use printf to preserve multi-line key formatting') alongside reverting to printf.

          # Use printf to preserve multi-line key formatting
          printf '%s' "${{ secrets.VM_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
[nitpick] The removed comment explained why printf was used to preserve key formatting; keeping a brief rationale helps prevent regressions. Consider restoring a short comment (e.g., 'Use printf to preserve multi-line key formatting') alongside reverting to printf. ```suggestion # Use printf to preserve multi-line key formatting printf '%s' "${{ secrets.VM_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa ```
Sign in to join this conversation.
No reviewers
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
rdenadai/web.redecapivara.social!18
No description provided.