mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
* use double quotes for string
This commit is contained in:
parent
df93f2048e
commit
e9c10d6221
4 changed files with 20 additions and 20 deletions
|
@ -16,7 +16,7 @@ steps:
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secret.SSH_KEY }}
|
private-key: ${{ secret.SSH_KEY }}
|
||||||
public-key: ${{ secret.SSH_KEY_PUBLIC }}
|
public-key: ${{ secret.SSH_KEY_PUBLIC }}
|
||||||
name: 'id_rsa' # optional
|
name: id_rsa # optional
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: apt install openssh-client rsync
|
run: apt install openssh-client rsync
|
||||||
- name: rsync over ssh
|
- name: rsync over ssh
|
||||||
|
|
22
action.yml
22
action.yml
|
@ -1,19 +1,19 @@
|
||||||
name: 'Install SSH Key'
|
name: "Install SSH Key"
|
||||||
description: 'Install SSH key to ~/.ssh'
|
description: "Install SSH key to ~/.ssh"
|
||||||
author: 'shimataro'
|
author: "shimataro"
|
||||||
branding:
|
branding:
|
||||||
icon: 'terminal'
|
icon: "terminal"
|
||||||
color: 'gray-dark'
|
color: "gray-dark"
|
||||||
inputs:
|
inputs:
|
||||||
private-key:
|
private-key:
|
||||||
description: 'private SSH key'
|
description: "private SSH key"
|
||||||
required: true
|
required: true
|
||||||
public-key:
|
public-key:
|
||||||
description: 'public SSH key'
|
description: "public SSH key"
|
||||||
required: true
|
required: true
|
||||||
name:
|
name:
|
||||||
description: 'SSH key file name (default: id_rsa)'
|
description: "SSH key file name (default: id_rsa)"
|
||||||
default: 'id_rsa'
|
default: "id_rsa"
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: "node12"
|
||||||
main: 'lib/main.js'
|
main: "lib/main.js"
|
||||||
|
|
|
@ -18,9 +18,9 @@ function main() {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
mode: 0o700,
|
mode: 0o700,
|
||||||
});
|
});
|
||||||
const privateKey = core.getInput('private-key');
|
const privateKey = core.getInput("private-key");
|
||||||
const publicKey = core.getInput('public-key');
|
const publicKey = core.getInput("public-key");
|
||||||
const name = core.getInput('name');
|
const name = core.getInput("name");
|
||||||
const fileName = path.resolve(dirName, name);
|
const fileName = path.resolve(dirName, name);
|
||||||
fs.writeFileSync(fileName, privateKey, {
|
fs.writeFileSync(fileName, privateKey, {
|
||||||
mode: 0o400,
|
mode: 0o400,
|
||||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -1,7 +1,7 @@
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as path from 'path';
|
import * as path from "path";
|
||||||
|
|
||||||
import * as core from '@actions/core';
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
function main(): void
|
function main(): void
|
||||||
{
|
{
|
||||||
|
@ -14,9 +14,9 @@ function main(): void
|
||||||
mode: 0o700,
|
mode: 0o700,
|
||||||
});
|
});
|
||||||
|
|
||||||
const privateKey = core.getInput('private-key') as string;
|
const privateKey = core.getInput("private-key") as string;
|
||||||
const publicKey = core.getInput('public-key') as string;
|
const publicKey = core.getInput("public-key") as string;
|
||||||
const name = core.getInput('name') as string;
|
const name = core.getInput("name") as string;
|
||||||
|
|
||||||
const fileName = path.resolve(dirName, name);
|
const fileName = path.resolve(dirName, name);
|
||||||
fs.writeFileSync(fileName, privateKey, {
|
fs.writeFileSync(fileName, privateKey, {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue