Skip to content

jk2K/ssh-setup-action

 
 

Repository files navigation

ssh-setup-action

Setup SSH

Release Codacy

Table of Contents

About

This GitHub action helps you to setup SSH.

It support Node.js 16+ for Linux and macOS runners.

Using

name: Example

on: [push]

jobs:
  example:
    name: Example
    runs-on: ubuntu-latest
    steps:
    - name: Setup SSH
      uses: MrSquaare/ssh-setup-action@v2
      with:
        host: github.com
        private-key: ${{ secrets.SSH_PRIVATE_KEY }}

Examples

Single key and clone

name: Clone repository

on: [push]

jobs:
  clone:
    name: Clone
    runs-on: ubuntu-latest
    steps:
    - name: Setup SSH
      uses: MrSquaare/ssh-setup-action@v2
      with:
        host: github.com
        private-key: ${{ secrets.SSH_PRIVATE_KEY }}
    - name: Clone repository
      run: git clone [email protected]:username/repository.git

Multiple keys and multiple clone

name: Clone repositories

on: [push]

jobs:
  clone:
    name: Clone
    runs-on: ubuntu-latest
    steps:
    - name: Setup GitHub SSH
      uses: MrSquaare/ssh-setup-action@v2
      with:
        host: github.com
        private-key: ${{ secrets.SSH_PRIVATE_KEY_GITHUB }}
        private-key-name: github
    - name: Setup GitLab SSH
      uses: MrSquaare/ssh-setup-action@v2
      with:
        host: gitlab.com
        private-key: ${{ secrets.SSH_PRIVATE_KEY_GITLAB }}
        private-key-name: gitlab
    - name: Clone GitHub repository
      run: git clone [email protected]:username/repository.git
    - name: Clone GitLab repository
      run: git clone [email protected]:username/repository.git

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

Setup SSH

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.8%
  • JavaScript 7.2%