mirror of
https://github.com/jnstockley/gh-ssh-action.git
synced 2026-06-05 11:17:57 -05:00
No description
- TypeScript 100%
|
|
||
|---|---|---|
| .github/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| .nvmrc | ||
| action.yml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| renovate.json | ||
| SECURITY.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
GitHub SSH Action
Run SSH commands against a remote host from GitHub Actions.
Usage
Password authentication
- name: Run SSH command
uses: your-org/gh-ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
command: "uname -a"
Key authentication (with passphrase)
- name: Run SSH command
uses: your-org/gh-ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
private_key: ${{ secrets.SSH_PRIVATE_KEY }}
private_key_passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }}
command: "uptime"
Multiple commands
- name: Run multiple SSH commands
uses: your-org/gh-ssh-action@v1
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
private_key: ${{ secrets.SSH_PRIVATE_KEY }}
command: |
whoami
pwd
ls -la
Inputs
host: SSH host to connect to. Required.username: SSH username. Required.port: SSH port. Default:22.password: SSH password (for password auth).private_key: SSH private key (for key auth). Use a multiline secret.private_key_passphrase: Passphrase for the SSH private key.command: Command to execute on the remote host. Required.
Outputs
stdout: Standard output from the remote command.stderr: Standard error from the remote command.exit_code: Exit code from the remote command.
Development
Requirements: Node.js 20+
npm install
npm test
npm run bundle
npm run bundlebuildsdist/index.js, which must be committed for GitHub Actions to run this action.- Update
action.ymlwhen you add inputs or outputs.
Release
- Run
npm testandnpm run bundle. - Commit the changes, including
dist/. - Create and push a tag, for example
v1.0.0. - (Optional) Move a major tag like
v1to the new release.
License
ISC