Skip to content
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
5 changes: 0 additions & 5 deletions .dcignore

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

11 changes: 0 additions & 11 deletions .eslintrc.js

This file was deleted.

35 changes: 23 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ jobs:
name: Build on ${{ matrix.os }} with Node ${{ matrix.node }}

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

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

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

- name: Install dependencies
run: |
Expand All @@ -51,12 +50,13 @@ jobs:
name: Test on ${{ matrix.os }}

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

- name: Setup GitHub SSH
uses: ./
id: github
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY_GITHUB }}
Expand All @@ -65,23 +65,34 @@ jobs:
run: |
git clone git@github.com:MrSquaare/private-repository.git

- name: Run tests for GitHub
env:
OUTPUT_SSH_PATH: ${{ steps.github.outputs.ssh-path }}
OUTPUT_SSH_AGENT_PID: ${{ steps.github.outputs.ssh-agent-pid }}
OUTPUT_SSH_AUTH_SOCK: ${{ steps.github.outputs.ssh-auth-sock }}
run:
sh ./test/test.sh

- name: Setup GitLab SSH
uses: ./
id: setup
id: gitlab
with:
host: gitlab.com
# GitLab supports SSH on port 443
# See https://docs.gitlab.com/user/gitlab_com/#alternative-ssh-port
host: altssh.gitlab.com
port: 443
private-key: ${{ secrets.SSH_PRIVATE_KEY_GITLAB }}
private-key-name: gitlab

- name: Clone GitLab repository
run: |
rm -rf private-repository
git clone git@gitlab.com:MrSquaare/private-repository.git
git clone ssh://git@altssh.gitlab.com:443/MrSquaare/private-repository.git

- name: Run tests
- name: Run tests for GitLab
env:
OUTPUT_SSH_PATH: ${{ steps.setup.outputs.ssh-path }}
OUTPUT_SSH_AGENT_PID: ${{ steps.setup.outputs.ssh-agent-pid }}
OUTPUT_SSH_AUTH_SOCK: ${{ steps.setup.outputs.ssh-auth-sock }}
OUTPUT_SSH_PATH: ${{ steps.gitlab.outputs.ssh-path }}
OUTPUT_SSH_AGENT_PID: ${{ steps.gitlab.outputs.ssh-agent-pid }}
OUTPUT_SSH_AUTH_SOCK: ${{ steps.gitlab.outputs.ssh-auth-sock }}
run:
sh ./test/test.sh
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ inputs:
required: true
port:
description: "SSH port"
type: number
default: 22
default: "22"
required: false
private-key:
description: "SSH private key"
Expand All @@ -20,8 +19,15 @@ inputs:
description: "SSH private key name"
default: "id_rsa"
required: false
outputs:
ssh-path:
description: "Path to the SSH private key"
ssh-agent-pid:
description: "PID of the SSH agent"
ssh-auth-sock:
description: "Path to the SSH auth socket"
runs:
using: "node20"
main: "lib/index.js"
post: 'lib/cleanup.js'
post-if: 'always()'
post: "lib/cleanup.js"
post-if: "always()"
10 changes: 10 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import js from "@eslint/js";
import prettier from "eslint-plugin-prettier/recommended";
import ts from "typescript-eslint";

export default ts.config(
{ ignores: ["lib/"] },
js.configs.recommended,
ts.configs.recommended,
prettier,
);
6 changes: 3 additions & 3 deletions lib/index.js

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssh-setup-action",
"version": "3.0.0",
"version": "3.1.1",
"description": "Setup SSH",
"repository": {
"type": "git",
Expand All @@ -21,23 +21,24 @@
"test": "sh ./test/test.sh"
},
"devDependencies": {
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"typescript": "^5.4.3"
"@eslint/js": "^9.33.0",
"@types/node": "^20.19.10",
"@vercel/ncc": "^0.38.3",
"eslint": "^9.33.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"prettier": "^3.6.2",
"typescript": "^5.9.2",
"typescript-eslint": "^8.39.1"
},
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"nanoid": "^5.0.6",
"nanoid": "^5.1.5",
"valid-filename": "^4.0.0"
},
"engines": {
"node": ">=20"
}
}
},
"packageManager": "pnpm@10.14.0"
}
Loading
Loading