Skip to content

Repository files navigation

ssh-setup-action

Setup SSH

ReleaseCodacy

Table of Contents

About

This GitHub action helps you to setup SSH.

Requires Runner v2.327.1 or later to run (Node.js 24 runtime).

Using

name: Exampleon: [push]jobs:
example:
name: Exampleruns-on: ubuntu-lateststeps:
- name: Setup SSHuses: MrSquaare/ssh-setup-action@v4with:
host: github.comprivate-key: ${{ secrets.SSH_PRIVATE_KEY }}

Environment variables

This action exports the following environment variables:

  • SSH_PATH: Path to SSH directory
  • SSH_AGENT_PID: PID of SSH agent
  • SSH_AUTH_SOCK: Path to SSH agent socket

Outputs

This action set the following outputs:

  • ssh-path: Path to SSH directory
  • ssh-agent-pid: PID of SSH agent
  • ssh-auth-sock: Path to SSH agent socket

Examples

Single key and clone

name: Clone repositoryon: [push]jobs:
clone:
name: Cloneruns-on: ubuntu-lateststeps:
- name: Setup SSHuses: MrSquaare/ssh-setup-action@v4with:
host: github.comprivate-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Clone repositoryrun: git clone git@github.com:username/repository.git

Multiple keys and multiple clone

name: Clone repositorieson: [push]jobs:
clone:
name: Cloneruns-on: ubuntu-lateststeps:
- name: Setup GitHub SSHuses: MrSquaare/ssh-setup-action@v4with:
host: github.comprivate-key: ${{ secrets.SSH_PRIVATE_KEY_GITHUB }}private-key-name: github
- name: Setup GitLab SSHuses: MrSquaare/ssh-setup-action@v4with:
host: gitlab.comprivate-key: ${{ secrets.SSH_PRIVATE_KEY_GITLAB }}private-key-name: gitlab
- name: Setup Server SSH with custom portuses: MrSquaare/ssh-setup-action@v4with:
host: 1.2.3.4port: 8000private-key: ${{ secrets.SSH_PRIVATE_KEY_CUSTOM }}private-key-name: server
- name: Clone GitHub repositoryrun: git clone git@github.com:username/repository.git
- name: Clone GitLab repositoryrun: git clone git@gitlab.com:username/repository.git
- name: SSH to serverrun: ssh -p 8000 ubuntu@1.2.3.4 'echo Hello'

Contributing

Bug reports, feature requests, other issues and pull requests are welcome. See CONTRIBUTING.md for more information.

License

Distributed under the MIT License. See LICENSE for more information.

About

UNOFFICIAL GIT REPOSITORY FORK from Guillaume Bonnet. Setup SSH GitHub Action

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages