Skip to content

This GitHub Action allows you to securely executing commands via SSH.

License

Notifications You must be signed in to change notification settings

YaCenturion/ssh-sh

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

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 GitHub Action: Remote executing commands

This GitHub Action allows you to securely executing commands via SSH.

Features

  • Secure SSH connection using a private key
  • Executing commands You can use in 2 steps
  • Easy integration into any workflow

🛠 Simple example

To use this action in your workflow, add the following to your .github/workflows/deploy.yml:

on:
  push:
    branches: [ "deploy" ]
  pull_request:
    branches: [ "deploy" ]
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Executing my commands
        uses: yacenturion/ssh-sh@v2
        with:
          HOST: "82.10.16.10"
          USERNAME: "root"
          SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
          RUN_MAIN: "whoami; touch nif-naf-nuf.txt"
          RUN_AFTER: "pwd; ls -la"

⚙️ All Inputs

Name Description Required
HOST Target server hostname or IP address. ✅ Yes
PORT Target port (default = 22). ❌ No
USERNAME SSH username for authentication. ✅ Yes
SSH_KEY Private SSH key for secure connection (use GitHub Secrets). ✅ Yes
RUN_MAIN Bash commands to execute ❌ No
RUN_AFTER Additional bash commands to execute after ❌ No

About

This GitHub Action allows you to securely executing commands via SSH.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published