Skip to content

A github action to execute remote commands via ssh.

License

Notifications You must be signed in to change notification settings

c-schicho/SSH-Action

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

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSH-Action

This is a simple action which only offers the bare minimum of options to execute a command on a remote host via ssh. The action only supports ssh keys currently, further options might be added in the future.

How to use this action

It is recommended to set the values for the action as secret, you can do this in your repository settings. An example workflow which uses this action would look like the following.

on:
  workflow_dispatch:

jobs:
  name: Execute remote command
  runs-on: ubuntu-latest
  steps:
    - name: Hello world
      uses: c-schicho/SSH-Action@v1
      with:
        host: ${{ secrets.SSH_HOST }}
        port: ${{ secrets.SSH_PORT }}
        user: ${{ secrets.SSH_USER }}
        key: ${{ secrets.SSH_KEY }}
        command: echo Hello world!

The port is optional and only needs to be specified when the used port is not the default port 22.