diff --git a/.github/workflows/verify-on-macos.yml b/.github/workflows/verify-on-macos.yml index 14653ca..469120b 100644 --- a/.github/workflows/verify-on-macos.yml +++ b/.github/workflows/verify-on-macos.yml @@ -13,7 +13,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional - name: print created files run: ls -l ~/.ssh - name: git clone through SSH @@ -28,7 +28,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional name: ssh_key_name # optional config: | # optional Host github diff --git a/.github/workflows/verify-on-ubuntu.yml b/.github/workflows/verify-on-ubuntu.yml index f50b4cd..e6548e1 100644 --- a/.github/workflows/verify-on-ubuntu.yml +++ b/.github/workflows/verify-on-ubuntu.yml @@ -13,7 +13,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional - name: print created files run: ls -l ~/.ssh - name: git clone through SSH @@ -28,7 +28,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional name: ssh_key_name # optional config: | # optional Host github diff --git a/.github/workflows/verify-on-ubuntu1604.yml b/.github/workflows/verify-on-ubuntu1604.yml index 7024e65..b3cce08 100644 --- a/.github/workflows/verify-on-ubuntu1604.yml +++ b/.github/workflows/verify-on-ubuntu1604.yml @@ -13,7 +13,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional - name: print created files run: ls -l ~/.ssh - name: git clone through SSH @@ -28,7 +28,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional name: ssh_key_name # optional config: | # optional Host github diff --git a/.github/workflows/verify-on-windows.yml b/.github/workflows/verify-on-windows.yml index a2332dd..003466f 100644 --- a/.github/workflows/verify-on-windows.yml +++ b/.github/workflows/verify-on-windows.yml @@ -13,7 +13,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional - name: print created files run: ls ~/.ssh - name: git clone through SSH @@ -28,7 +28,7 @@ jobs: uses: ./. with: key: ${{ secrets.SSH_KEY }} - known-hosts: ${{ secrets.KNOWN_HOSTS }} # optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional name: ssh_key_name # optional config: | # optional Host github diff --git a/CHANGELOG.md b/CHANGELOG.md index 8746d25..55bebe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed * rename `private-key` to `key` +* rename `known-hosts` to `known_hosts` ## [1.6.4] - 2020-01-27 diff --git a/README.md b/README.md index d3e9bc7..ac298dc 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ steps: with: key: ${{ secrets.SSH_KEY }} name: id_rsa # optional - known-hosts: ${{ secrets.KNOWN_HOSTS }} # known_hosts; optional + known_hosts: ${{ secrets.KNOWN_HOSTS }} # optional config: ${{ secrets.CONFIG }} # ssh_config; optional - name: rsync over ssh run: rsync ./foo/ user@remote:bar/ @@ -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. It is useful for port forwarding. -**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. +**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 runs-on: ubuntu-latest @@ -52,7 +52,7 @@ steps: with: key: ${{ secrets.SSH_KEY_OF_BASTION }} name: id_rsa-bastion - known-hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }} + known_hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }} config: | Host bastion HostName xxx.xxx.xxx.xxx @@ -63,7 +63,7 @@ steps: with: key: ${{ secrets.SSH_KEY_OF_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! Host target HostName yyy.yyy.yyy.yyy @@ -84,9 +84,9 @@ Check belows: * OPENSSH format (key begins with `-----BEGIN OPENSSH PRIVATE KEY-----`) may not work. * Use PEM format (begins with `-----BEGIN RSA PRIVATE KEY-----`). * `Host key verification failed.`: - * Set `known-hosts` option or use `ssh -o StrictHostKeyChecking=no`. + * Set `known_hosts` option or use `ssh -o StrictHostKeyChecking=no`. * The former is **HIGHLY** recommended for security reason. - * I'm planning to make `known-hosts` required in v2. + * I'm planning to make `known_hosts` required in v2. ### How do I use encrypted SSH key? @@ -104,7 +104,7 @@ I recommend **rsync via bastion**. It has some advantages over other methods: * "Rsync via bastion" doesn't require to update workflow files and `secrets` even if it is necessary to transfer files to multiple servers. - * Other methods require to update `known-hosts` if servers have changed. + * Other methods require to update `known_hosts` if servers have changed. * Rsync: * is fastest of all. * does **NOT** break files even if disconnected during transferring. diff --git a/action.yml b/action.yml index 9974c8b..aef5b4e 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,7 @@ inputs: description: "SSH key file name (default: id_rsa)" required: false default: "id_rsa" - known-hosts: + known_hosts: description: "public keys of SSH servers" required: false default: "" diff --git a/lib/main.js b/lib/main.js index ede1edf..b97cccb 100644 --- a/lib/main.js +++ b/lib/main.js @@ -28,7 +28,7 @@ function main() { }, { name: "known_hosts", - contents: prependLf(core.getInput("known-hosts")), + contents: prependLf(core.getInput("known_hosts")), options: { mode: 0o644, flag: "a", diff --git a/src/main.ts b/src/main.ts index 62a5520..b3aa60c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -30,7 +30,7 @@ function main(): void }, { name: "known_hosts", - contents: prependLf(core.getInput("known-hosts")), + contents: prependLf(core.getInput("known_hosts")), options: { mode: 0o644, flag: "a",