Skip to content

πŸ” Simple GitHub Action to run commands on a remote server using SSH.

License

Notifications You must be signed in to change notification settings

garygrossgarten/github-action-ssh

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f52509e Β· Jul 11, 2024

History

93 Commits
Apr 5, 2024
Jul 11, 2024
Oct 14, 2022
Jan 6, 2021
Aug 28, 2019
Apr 5, 2024
Apr 15, 2020
Apr 15, 2020
Aug 28, 2019
Apr 5, 2024
Apr 5, 2024
Apr 5, 2024
Jul 11, 2024
Apr 5, 2024
Aug 30, 2019
Apr 15, 2020

Repository files navigation

GitHub Action SSH

Simple GitHub Action to run a command on a remote server using SSH. This is working with the latest GitHub Actions.

See the δΈ­ζ–‡ζ–‡ζ‘£ for Chinese readme.

✨ Example Usage

Example using OpenSSH encrypted private key

- name: ls -a via ssh
  uses: garygrossgarten/github-action-ssh@release
  with:
    command: ls -a
    host: ${{ secrets.HOST }}
    username: garygrossgarten
    passphrase: ${{ secrets.PASSPHRASE }}
    privateKey: ${{ secrets.PRIVATE_KEY}}

πŸ” Set your secrets here: https://github.com/USERNAME/REPO/settings/secrets.

Check out the workflow example for a minimalistic yaml workflow in GitHub Actions.

Result

result of example ssh workflow

Options

  • host - string - Hostname or IP address of the server. Default: 'localhost'

  • port - integer - Port number of the server. Default: 22

  • username - string - Username for authentication. Default: (none)

  • password - string - Password for password-based user authentication. Default: (none)

  • privateKey - mixed - Buffer or string that contains a private key for either key-based or hostbased user authentication (OpenSSH format). Default: (none)

  • passphrase - string - For an encrypted private key, this is the passphrase used to decrypt it. Default: (none)

  • tryKeyboard - boolean - Try keyboard-interactive user authentication if primary user authentication method fails. Default: false

Development


This thing is built using Typescript and ssh2 (via node-ssh). πŸš€