Skip to content

Commit 3d5bb31

Browse files
committed
docs: add SSH passphrase best practices to GitHub documentation
1 parent c9e7402 commit 3d5bb31

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

packages/docs/docs/usage/github-action.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ Configure Git with appropriate user information for commits made by MyCoder:
158158

159159
This clearly identifies commits made automatically by MyCoder.
160160

161+
### SSH Authentication
162+
163+
When using GitHub Actions with SSH authentication:
164+
165+
1. **Avoid SSH Keys with Passphrases**: For automated environments like GitHub Actions, use SSH keys without passphrases or use alternative authentication methods.
166+
167+
2. **Use HTTPS with PAT**: Consider using HTTPS authentication with a Personal Access Token (PAT) for GitHub Actions to avoid SSH passphrase prompts.
168+
169+
3. **If SSH is Required**: If you must use SSH authentication in GitHub Actions, ensure your workflow doesn't require interactive passphrase entry by:
170+
- Using SSH keys without passphrases for automation purposes only
171+
- Configuring the SSH agent properly in your workflow
172+
161173
## Usage Examples
162174

163175
### Trigger MyCoder on an Issue

packages/docs/docs/usage/github-mode.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,38 @@ If your team uses a complex GitHub workflow (e.g., with code owners, required re
138138
- **Authentication Problems**: Ensure you've run `gh auth login` successfully
139139
- **Permission Issues**: Verify you have write access to the repository
140140
- **Branch Protection**: Some repositories have branch protection rules that may prevent direct pushes
141+
- **SSH Passphrase Prompts**: If you use SSH keys with passphrases, automated workflows may be interrupted by passphrase prompts
142+
143+
### SSH Passphrase Best Practices
144+
145+
When using GitHub mode with SSH authentication, it's important to properly manage SSH key passphrases to ensure automation works smoothly:
146+
147+
1. **Use SSH Agent**: Configure ssh-agent to remember your passphrase, so you don't need to enter it repeatedly:
148+
149+
```bash
150+
# Start the ssh-agent in the background
151+
eval "$(ssh-agent -s)"
152+
153+
# Add your SSH private key to the ssh-agent
154+
ssh-add ~/.ssh/id_ed25519 # Replace with your key path
155+
```
156+
157+
2. **Configure SSH Agent to Persist**:
158+
- On macOS, you can use the keychain to remember your passphrase:
159+
```bash
160+
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
161+
```
162+
- On other systems, consider using tools like `keychain` or configuring your desktop environment to start ssh-agent automatically
163+
164+
3. **Create Config File** (optional): Create or edit `~/.ssh/config` to use the ssh-agent:
165+
```
166+
Host github.com
167+
AddKeysToAgent yes
168+
UseKeychain yes # macOS only
169+
IdentityFile ~/.ssh/id_ed25519
170+
```
171+
172+
Without proper SSH agent configuration, MyCoder may be interrupted by passphrase prompts during Git operations, which can cause timeouts in automated environments.
141173
142174
If you encounter any issues with GitHub mode, you can check the GitHub CLI status with:
143175

0 commit comments

Comments
 (0)