Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add custom port support #48

Merged
merged 6 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 git@github.com:username/repository.git
- name: Clone GitLab repository
run: git clone git@gitlab.com:username/repository.git
- name: SSH to server
run: ssh -p 8000 ubuntu@1.2.3.4 '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
Loading