1
0
Fork 0
mirror of https://github.com/shimataro/ssh-key-action.git synced 2025-06-19 22:52:10 +10:00

Merge branch 'feature/v2' into feature/rename-known-hosts

This commit is contained in:
shimataro 2020-02-07 21:14:05 +09:00 committed by GitHub
commit 04ef7d8ec3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 26 additions and 25 deletions

View file

@ -3,9 +3,9 @@ env: # https://eslint.org/docs/user-guide/configuring#specifying-environments
es6: true es6: true
node: true node: true
extends: extends:
- eslint:recommended - eslint:recommended
- plugin:@typescript-eslint/eslint-recommended - plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended - plugin:@typescript-eslint/recommended
plugins: plugins:
- import - import
- "@typescript-eslint" - "@typescript-eslint"

View file

@ -12,7 +12,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
- name: print created files - name: print created files
run: ls -l ~/.ssh run: ls -l ~/.ssh
@ -27,7 +27,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
name: ssh_key_name # optional name: ssh_key_name # optional
config: | # optional config: | # optional

View file

@ -12,7 +12,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
- name: print created files - name: print created files
run: ls -l ~/.ssh run: ls -l ~/.ssh
@ -27,7 +27,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
name: ssh_key_name # optional name: ssh_key_name # optional
config: | # optional config: | # optional

View file

@ -12,7 +12,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
- name: print created files - name: print created files
run: ls -l ~/.ssh run: ls -l ~/.ssh
@ -27,7 +27,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
name: ssh_key_name # optional name: ssh_key_name # optional
config: | # optional config: | # optional

View file

@ -12,7 +12,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
- name: print created files - name: print created files
run: ls ~/.ssh run: ls ~/.ssh
@ -27,7 +27,7 @@ jobs:
- name: Install SSH key - name: Install SSH key
uses: ./. uses: ./.
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
name: ssh_key_name # optional name: ssh_key_name # optional
config: | # optional config: | # optional

View file

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed ### Changed
* rename `private-key` to `key`
* rename `known-hosts` to `known_hosts` * rename `known-hosts` to `known_hosts`
## [1.6.4] - 2020-01-27 ## [1.6.4] - 2020-01-27

View file

@ -27,7 +27,7 @@ steps:
- name: Install SSH key - name: Install SSH key
uses: shimataro/ssh-key-action@v1 uses: shimataro/ssh-key-action@v1
with: with:
private-key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
name: id_rsa # optional name: id_rsa # optional
known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional
config: ${{ secrets.CONFIG }} # ssh_config; optional config: ${{ secrets.CONFIG }} # ssh_config; optional
@ -42,7 +42,7 @@ See [Workflow syntax for GitHub Actions](https://help.github.com/en/articles/wor
If you want to install multiple keys, call this action multiple times. If you want to install multiple keys, call this action multiple times.
It is useful for port forwarding. It is useful for port forwarding.
**NOTE:** When this action is called multiple times, **the contents of `known_hosts` and `config` will be appended**. `private-key` must be saved as different name, by using `name` option. **NOTE:** When this action is called multiple times, **the contents of `known_hosts` and `config` will be appended**. `key` must be saved as different name, by using `name` option.
```yaml ```yaml
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -50,7 +50,7 @@ steps:
- name: Install SSH key of bastion - name: Install SSH key of bastion
uses: shimataro/ssh-key-action@v1 uses: shimataro/ssh-key-action@v1
with: with:
private-key: ${{ secrets.SSH_KEY_OF_BASTION }} key: ${{ secrets.SSH_KEY_OF_BASTION }}
name: id_rsa-bastion name: id_rsa-bastion
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }} known_hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }}
config: | config: |
@ -61,7 +61,7 @@ steps:
- name: Install SSH key of target - name: Install SSH key of target
uses: shimataro/ssh-key-action@v1 uses: shimataro/ssh-key-action@v1
with: with:
private-key: ${{ secrets.SSH_KEY_OF_TARGET }} key: ${{ secrets.SSH_KEY_OF_TARGET }}
name: id_rsa-target name: id_rsa-target
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }} # will be appended! known_hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }} # will be appended!
config: | # will be appended! config: | # will be appended!
@ -126,15 +126,15 @@ The scripts and documentation in this project are released under the [MIT Licens
See [CHANGELOG.md](CHANGELOG.md). See [CHANGELOG.md](CHANGELOG.md).
[image-build]: https://github.com/shimataro/ssh-key-action/workflows/Build/badge.svg?event=push&branch=v1 [image-build]: https://github.com/shimataro/ssh-key-action/workflows/Build/badge.svg?event=push&branch=v1
[link-build]: https://github.com/shimataro/ssh-key-action [link-build]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3ABuild
[image-verify-windows]: https://github.com/shimataro/ssh-key-action/workflows/Windows/badge.svg?event=push&branch=v1 [image-verify-windows]: https://github.com/shimataro/ssh-key-action/workflows/Windows/badge.svg?event=push&branch=v1
[link-verify-windows]: https://github.com/shimataro/ssh-key-action [link-verify-windows]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3AWindows
[image-verify-macos]: https://github.com/shimataro/ssh-key-action/workflows/macOS/badge.svg?event=push&branch=v1 [image-verify-macos]: https://github.com/shimataro/ssh-key-action/workflows/macOS/badge.svg?event=push&branch=v1
[link-verify-macos]: https://github.com/shimataro/ssh-key-action [link-verify-macos]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3AmacOS
[image-verify-ubuntu]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu/badge.svg?event=push&branch=v1 [image-verify-ubuntu]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu/badge.svg?event=push&branch=v1
[link-verify-ubuntu]: https://github.com/shimataro/ssh-key-action [link-verify-ubuntu]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3AUbuntu
[image-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg?event=push&branch=v1 [image-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg?event=push&branch=v1
[link-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action [link-verify-ubuntu1604]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3A%22Ubuntu+16.04%22
[image-release]: https://img.shields.io/github/release/shimataro/ssh-key-action.svg [image-release]: https://img.shields.io/github/release/shimataro/ssh-key-action.svg
[link-release]: https://github.com/shimataro/ssh-key-action/releases [link-release]: https://github.com/shimataro/ssh-key-action/releases
[image-license]: https://img.shields.io/github/license/shimataro/ssh-key-action.svg [image-license]: https://img.shields.io/github/license/shimataro/ssh-key-action.svg

View file

@ -6,8 +6,8 @@ branding:
icon: "terminal" icon: "terminal"
color: "gray-dark" color: "gray-dark"
inputs: inputs:
private-key: key:
description: "private SSH key" description: "SSH private key"
required: true required: true
name: name:
description: "SSH key file name (default: id_rsa)" description: "SSH key file name (default: id_rsa)"

View file

@ -18,7 +18,7 @@ function main() {
const files = [ const files = [
{ {
name: core.getInput("name"), name: core.getInput("name"),
contents: core.getInput("private-key", { contents: core.getInput("key", {
required: true, required: true,
}), }),
options: { options: {

View file

@ -1 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AAStC;;GAEG;AACH,SAAS,IAAI;IAEZ,IACA;QACC,MAAM,KAAK,GAAe;YACzB;gBACC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;oBACtC,QAAQ,EAAE,IAAI;iBACd,CAAC;gBACF,OAAO,EAAE;oBACR,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,IAAI;iBACV;aACD;YACD;gBACC,IAAI,EAAE,aAAa;gBACnB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;gBACjD,OAAO,EAAE;oBACR,IAAI,EAAE,KAAK;oBACX,IAAI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{
name: core.getInput("name"), name: core.getInput("name"),
contents: core.getInput("private-key", { contents: core.getInput("key", {
required: true, required: true,
}), }),
options: { options: {