Skip to content

Commit

Permalink
Merge pull request MrSquaare#48 from kemchenj/main
Browse files Browse the repository at this point in the history
feat: Add custom port support
  • Loading branch information
MrSquaare authored Mar 22, 2024
2 parents 7bfdda6 + ea1adb7 commit 2d028b7
Show file tree
Hide file tree
Showing 9 changed files with 1,183 additions and 3,689 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,43 @@ jobs:
name: Build on ${{ matrix.os }} with Node ${{ matrix.node }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install dependencies
run: |
npm install
pnpm install
- name: Build
run: |
npm run build
pnpm build
test:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
node:
- 20

runs-on: ${{ matrix.os }}

name: Test on ${{ matrix.os }} with Node ${{ matrix.node }}
name: Test on ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup GitHub SSH
uses: ./
Expand Down Expand Up @@ -77,4 +84,4 @@ jobs:
OUTPUT_SSH_AGENT_PID: ${{ steps.setup.outputs.ssh-agent-pid }}
OUTPUT_SSH_AUTH_SOCK: ${{ steps.setup.outputs.ssh-auth-sock }}
run:
npm run test
sh ./test/test.sh
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ See [GUIDELINES.md](GUIDELINES.md) for more information.

### Prerequisites

1. Install [act](https://github.com/nektos/act#installation)
1. Install [Node.js](https://nodejs.org/en/download/)
2. Install [pnpm](https://pnpm.io/installation)
3. Install [act](https://github.com/nektos/act#installation)

### Installation

Expand All @@ -30,29 +32,29 @@ git clone https://github.com/MrSquaare/ssh-setup-action.git
2. Install dependencies:

```shell script
npm install
pnpm install
```

## Building

Build the project:

```shell script
npm run build
pnpm build
```

## Testing

Lint the code:

```shell script
npm run lint
pnpm lint
```

Format the code:

```shell script
npm run format
pnpm format
```

Run workflows with [act](https://github.com/nektos/act):
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,19 @@ jobs:
host: gitlab.com
private-key: ${{ secrets.SSH_PRIVATE_KEY_GITLAB }}
private-key-name: gitlab
- name: Setup Server SSH with custom port
uses: MrSquaare/ssh-setup-action@v3
with:
host: 1.2.3.4
port: 8000
private-key: ${{ secrets.SSH_PRIVATE_KEY_GITLAB }}
private-key-name: server
- name: Clone GitHub repository
run: git clone [email protected]:username/repository.git
- name: Clone GitLab repository
run: git clone [email protected]:username/repository.git
- name: SSH to server
run: ssh -p 8000 [email protected] 'echo Hello'
```

## Contributing
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ inputs:
host:
description: "SSH host"
required: true
port:
description: "SSH port"
type: number
default: 22
required: false
private-key:
description: "SSH private key"
required: true
Expand Down
4 changes: 3 additions & 1 deletion lib/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2d028b7

Please sign in to comment.