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

Merge pull request #222 from shimataro/develop

version 2.4.0
This commit is contained in:
shimataro 2022-11-03 05:05:47 +09:00 committed by GitHub
commit 86a65fd09b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 10724 additions and 2890 deletions

View file

@ -25,6 +25,13 @@ spaces_around_brackets = none
indent_brace_style = allman
# JavaScript/TypeScript
[*.{js,ts}]
indent_style = space
curly_bracket_next_line = false
indent_brace_style = K&R
# JSON/YAML
[*.{json,babelrc,code-workspace,yml,yaml}]
indent_style = space

View file

@ -14,7 +14,9 @@ parserOptions:
project: ./tsconfig.json
rules: # https://eslint.org/docs/rules/
accessor-pairs: error
array-bracket-newline: error
array-bracket-newline:
- error
- consistent
array-bracket-spacing:
- error
- never
@ -29,9 +31,7 @@ rules: # https://eslint.org/docs/rules/
before: true
block-scoped-var: error
block-spacing: error
brace-style:
- error
- allman
brace-style: 'off' # see "@typescript-eslint/brace-style"
callback-return: error
capitalized-comments: 'off'
class-methods-use-this: error
@ -87,26 +87,14 @@ rules: # https://eslint.org/docs/rules/
- below
indent:
- error
- tab
- 4
- SwitchCase: 1
indent-legacy: 'off'
init-declarations: error
jsx-quotes: error
key-spacing: error
keyword-spacing:
- error
- overrides:
catch:
after: false
for:
after: false
if:
after: false
switch:
after: false
while:
after: false
with:
after: false
line-comment-position: 'off'
linebreak-style:
- error
@ -256,7 +244,7 @@ rules: # https://eslint.org/docs/rules/
rest-spread-spacing:
- error
- never
semi: error
semi: 'off' # see "@typescript-eslint/semi"
semi-spacing: error
semi-style:
- error
@ -308,8 +296,25 @@ rules: # https://eslint.org/docs/rules/
# @typescript-eslint plugin
"@typescript-eslint/ban-ts-ignore": 'off'
"@typescript-eslint/brace-style":
- error
- 1tbs
"@typescript-eslint/member-delimiter-style":
- error
- multiline:
delimiter: semi
requireLast: true
singleline:
delimiter: semi
requireLast: true
"@typescript-eslint/no-empty-interface": 'off'
"@typescript-eslint/no-floating-promises": error
"@typescript-eslint/no-use-before-define":
- error
- functions: false
"@typescript-eslint/strict-boolean-expressions": error
"@typescript-eslint/semi": error
"@typescript-eslint/strict-boolean-expressions":
- error
- allowString: false
allowNumber: false
allowNullableObject: false

View file

@ -13,12 +13,15 @@ jobs:
matrix:
os:
- Windows-2019
- Windows-2022
- macOS-10.15
- Ubuntu-16.04
- macOS-11
- macOS-12
- Ubuntu-18.04
- Ubuntu-20.04
- Ubuntu-22.04
nodejs:
- 12
- 16
fail-fast: false
steps:
- name: Turn off auto-crlf

View file

@ -15,6 +15,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -30,11 +31,42 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pem-bitbucket:
name: Connect to bitbucket.org (PEM format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
- alpine:3.12
- alpine:3.13
fail-fast: false
steps:
- name: Install packages
run: apk add openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-pkcs8:
name: Connect to github.com (PKCS8 format)
runs-on: ${{ matrix.os }}
@ -44,6 +76,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -59,11 +92,42 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pkcs8-bitbucket:
name: Connect to bitbucket.org (PKCS8 format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
- alpine:3.12
- alpine:3.13
fail-fast: false
steps:
- name: Install packages
run: apk add openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-rfc4716:
name: Connect to github.com (RFC4716 format)
runs-on: ${{ matrix.os }}
@ -73,6 +137,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -88,11 +153,42 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-rfc4716-bitbucket:
name: Connect to bitbucket.org (RFC4716 format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
- alpine:3.12
- alpine:3.13
fail-fast: false
steps:
- name: Install packages
run: apk add openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
key_if_exists_replace-key_exists:
name: if_key_exists=replace / key exists
@ -104,6 +200,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -118,12 +215,12 @@ jobs:
uses: ./.
with:
key: "dummy" # replaced
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l /root/.ssh
@ -139,6 +236,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -153,7 +251,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l /root/.ssh
@ -170,6 +268,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -184,12 +283,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l /root/.ssh
@ -205,6 +304,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -219,7 +319,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l /root/.ssh
@ -236,6 +336,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -250,12 +351,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
continue-on-error: true
- name: print created files
@ -272,6 +373,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- alpine:3.10
- alpine:3.11
@ -286,37 +388,9 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
known_hosts-unnecessary:
name: without known_hosts file
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
container:
- alpine:3.10
- alpine:3.11
- alpine:3.12
- alpine:3.13
steps:
- name: Install packages
run: apk add openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh

View file

@ -15,9 +15,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
fail-fast: false
steps:
- name: Install packages
@ -29,11 +30,41 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pem-bitbucket:
name: Connect to bitbucket.org (PEM format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
fail-fast: false
steps:
- name: Install packages
run: |
yum install -y git openssh-clients
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-pkcs8:
name: Connect to github.com (PKCS8 format)
runs-on: ${{ matrix.os }}
@ -43,9 +74,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
fail-fast: false
steps:
- name: Install packages
@ -57,11 +89,41 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pkcs8-bitbucket:
name: Connect to bitbucket.org (PKCS8 format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
fail-fast: false
steps:
- name: Install packages
run: |
yum install -y git openssh-clients
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-rfc4716:
name: Connect to github.com (RFC4716 format)
runs-on: ${{ matrix.os }}
@ -71,9 +133,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
fail-fast: false
steps:
- name: Install packages
@ -85,11 +148,41 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-rfc4716-bitbucket:
name: Connect to bitbucket.org (RFC4716 format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
fail-fast: false
steps:
- name: Install packages
run: |
yum install -y git openssh-clients
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
key_if_exists_replace-key_exists:
name: if_key_exists=replace / key exists
@ -101,9 +194,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
steps:
- name: Install packages
run: |
@ -114,12 +208,12 @@ jobs:
uses: ./.
with:
key: "dummy" # replaced
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l /root/.ssh
@ -135,9 +229,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
steps:
- name: Install packages
run: |
@ -148,7 +243,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l /root/.ssh
@ -165,9 +260,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
steps:
- name: Install packages
run: |
@ -178,12 +274,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l /root/.ssh
@ -199,9 +295,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
steps:
- name: Install packages
run: |
@ -212,7 +309,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l /root/.ssh
@ -229,9 +326,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
steps:
- name: Install packages
run: |
@ -242,12 +340,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
continue-on-error: true
- name: print created files
@ -264,9 +362,10 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- centos:7
- centos:8
- quay.io/centos/centos:centos7
- quay.io/centos/centos:stream8
steps:
- name: Install packages
run: |
@ -277,36 +376,9 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
known_hosts-unnecessary:
name: without known_hosts file
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
container:
- centos:7
- centos:8
steps:
- name: Install packages
run: |
yum install -y git openssh-clients
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh

View file

@ -15,10 +15,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
fail-fast: false
steps:
- name: Install packages
@ -31,11 +33,44 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pem-bitbucket:
name: Connect to bitbucket.org (PEM format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
fail-fast: false
steps:
- name: Install packages
run: |
apt update
apt install -y openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-pkcs8:
name: Connect to github.com (PKCS8 format)
runs-on: ${{ matrix.os }}
@ -45,10 +80,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
fail-fast: false
steps:
- name: Install packages
@ -61,11 +98,44 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pkcs8-bitbucket:
name: Connect to bitbucket.org (PKCS8 format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
fail-fast: false
steps:
- name: Install packages
run: |
apt update
apt install -y openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-rfc4716:
name: Connect to github.com (RFC4716 format)
runs-on: ${{ matrix.os }}
@ -75,10 +145,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
fail-fast: false
steps:
- name: Install packages
@ -91,11 +163,44 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-rfc4716-bitbucket:
name: Connect to bitbucket.org (RFC4716 format)
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
fail-fast: false
steps:
- name: Install packages
run: |
apt update
apt install -y openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
key_if_exists_replace-key_exists:
name: if_key_exists=replace / key exists
@ -107,10 +212,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
steps:
- name: Install packages
run: |
@ -122,12 +229,12 @@ jobs:
uses: ./.
with:
key: "dummy" # replaced
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l /root/.ssh
@ -143,10 +250,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
steps:
- name: Install packages
run: |
@ -158,7 +267,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l /root/.ssh
@ -175,10 +284,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
steps:
- name: Install packages
run: |
@ -190,12 +301,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l /root/.ssh
@ -211,10 +322,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
steps:
- name: Install packages
run: |
@ -226,7 +339,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l /root/.ssh
@ -243,10 +356,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
steps:
- name: Install packages
run: |
@ -258,12 +373,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
continue-on-error: true
- name: print created files
@ -280,10 +395,12 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
steps:
- name: Install packages
run: |
@ -295,38 +412,9 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
- name: print created files
run: ls -l /root/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
known_hosts-unnecessary:
name: without known_hosts file
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
container:
- ubuntu:16.04
- ubuntu:18.04
- ubuntu:20.04
steps:
- name: Install packages
run: |
apt update
apt -y install openssh-client git
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: unnecessary
- name: print created files
run: ls -l /root/.ssh

View file

@ -14,6 +14,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -21,11 +23,34 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pem-bitbucket:
name: Connect to bitbucket.org (PEM format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-pkcs8:
name: Connect to github.com (PKCS8 format)
runs-on: ${{ matrix.os }}
@ -34,6 +59,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -41,11 +68,34 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pkcs8-bitbucket:
name: Connect to bitbucket.org (PKCS8 format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-rfc4716:
name: Connect to github.com (RFC4716 format)
runs-on: ${{ matrix.os }}
@ -54,6 +104,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -61,11 +113,35 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-rfc4716-bitbucket:
name: Connect to bitbucket.org (RFC4716 format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-with-name:
name: Connect to github.com with name and config
runs-on: ${{ matrix.os }}
@ -74,6 +150,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -81,7 +159,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
name: ssh_key_name # optional
config: | # optional
Host github
@ -101,6 +179,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -108,12 +188,12 @@ jobs:
uses: ./.
with:
key: "dummy" # replaced
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l ~/.ssh
@ -127,6 +207,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -134,7 +216,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l ~/.ssh
@ -149,6 +231,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -156,12 +240,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
@ -175,6 +259,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -182,7 +268,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
@ -197,6 +283,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -204,12 +292,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
continue-on-error: true
- name: print created files
@ -224,6 +312,8 @@ jobs:
matrix:
os:
- macos-10.15
- macos-11
- macos-12
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -231,28 +321,9 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
known_hosts-unnecessary:
name: without known_hosts file
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh

View file

@ -15,6 +15,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -22,11 +23,34 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pem-bitbucket:
name: Connect to bitbucket.org (PEM format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-pkcs8:
name: Connect to github.com (PKCS8 format)
runs-on: ${{ matrix.os }}
@ -36,6 +60,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -43,11 +68,34 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pkcs8-bitbucket:
name: Connect to bitbucket.org (PKCS8 format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-rfc4716:
name: Connect to github.com (RFC4716 format)
runs-on: ${{ matrix.os }}
@ -57,6 +105,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -64,11 +113,35 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-rfc4716-bitbucket:
name: Connect to bitbucket.org (RFC4716 format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-with-name:
name: Connect to github.com with name and config
runs-on: ${{ matrix.os }}
@ -78,6 +151,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -85,7 +159,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
name: ssh_key_name # optional
config: | # optional
Host github
@ -106,6 +180,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -113,12 +188,12 @@ jobs:
uses: ./.
with:
key: "dummy" # replaced
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l ~/.ssh
@ -133,6 +208,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -140,7 +216,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l ~/.ssh
@ -156,6 +232,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -163,12 +240,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
@ -183,6 +260,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -190,7 +268,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
@ -206,6 +284,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -213,12 +292,12 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
continue-on-error: true
- name: print created files
@ -234,6 +313,7 @@ jobs:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -241,29 +321,9 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
known_hosts-unnecessary:
name: without known_hosts file
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh

View file

@ -13,8 +13,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -22,11 +22,33 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pem-bitbucket:
name: Connect to bitbucket.org (PEM format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-pkcs8:
name: Connect to github.com (PKCS8 format)
runs-on: ${{ matrix.os }}
@ -34,8 +56,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -43,11 +65,33 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-pkcs8-bitbucket:
name: Connect to bitbucket.org (PKCS8 format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PKCS8 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-rfc4716:
name: Connect to github.com (RFC4716 format)
runs-on: ${{ matrix.os }}
@ -55,8 +99,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -64,11 +108,34 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: print created files
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
ssh-rfc4716-bitbucket:
name: Connect to bitbucket.org (RFC4716 format)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_RFC4716 }}
known_hosts: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
- name: print created files
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
ssh-with-name:
name: Connect to github.com with name and config
runs-on: ${{ matrix.os }}
@ -76,8 +143,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -85,7 +152,7 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
name: ssh_key_name # optional
config: | # optional
Host github
@ -93,7 +160,7 @@ jobs:
User git
IdentityFile ~/.ssh/ssh_key_name
- name: print created files
run: ls -l ~/.ssh
run: ls ~/.ssh
- name: git clone through SSH
run: git clone github:shimataro/ssh-key-action.git tmp
@ -104,8 +171,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -113,15 +180,15 @@ jobs:
uses: ./.
with:
key: "dummy" # replaced
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l ~/.ssh
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
key_if_exists_replace-key_doesnt_exist:
@ -131,8 +198,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -140,10 +207,10 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: replace
- name: print created files
run: ls -l ~/.ssh
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
@ -154,8 +221,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -163,15 +230,15 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
key_if_exists_ignore-key_doesnt_exist:
@ -181,8 +248,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -190,10 +257,10 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
@ -204,8 +271,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -213,16 +280,16 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
continue-on-error: true
- name: print created files
run: ls -l ~/.ssh
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
key_if_exists_fail-key_doesnt_exist:
@ -232,8 +299,8 @@ jobs:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- name: Checkout source codes
uses: actions/checkout@v2
@ -241,29 +308,9 @@ jobs:
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
known_hosts: unnecessary
if_key_exists: fail
- name: print created files
run: ls -l ~/.ssh
run: ls ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
known_hosts-unnecessary:
name: without known_hosts file
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2016
- windows-2019
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: unnecessary
- name: print created files
run: ls -l ~/.ssh

3
.gitignore vendored
View file

@ -13,5 +13,8 @@ Thumbs.db
*.orig
*.rej
# IDE
/.idea/
# Node.js modules
/node_modules/

View file

@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
## [2.4.0] - 2022-11-03
### Added
* always set server key of `github.com` to `known_hosts`
### Fixed
* usage of `rsync` in README
### Others
* add `windows-2022`, and `macos-11` (thanks [@ViacheslavKudinov](https://github.com/ViacheslavKudinov))
* add `macos-12`, `ubuntu-22.04`, and `CentOS 8 Stream (Docker container)`
* drop `ubuntu-16.04`, and `CentOS 8 (Docker container)`
* [update Node.js version to 16](https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/) (thanks [@duddu](https://github.com/duddu))
## [2.3.1] - 2021-08-01
### Security
@ -157,7 +174,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* First release.
[Unreleased]: https://github.com/shimataro/ssh-key-action/compare/v2.3.1...HEAD
[Unreleased]: https://github.com/shimataro/ssh-key-action/compare/v2.4.0...HEAD
[2.4.0]: https://github.com/shimataro/ssh-key-action/compare/v2.3.1...v2.4.0
[2.3.1]: https://github.com/shimataro/ssh-key-action/compare/v2.3.0...v2.3.1
[2.3.0]: https://github.com/shimataro/ssh-key-action/compare/v2.2.0...v2.3.0
[2.2.0]: https://github.com/shimataro/ssh-key-action/compare/v2.1.0...v2.2.0

View file

@ -17,9 +17,9 @@ Useful for SCP, SFTP, and `rsync` over SSH in deployment script.
tested on:
* [all available virtual machines](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources) (Windows Server 2019/2016, macOS Catalina, and Ubuntu 20.04/18.04)
* [all available virtual machines](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources) (Windows Server 2022/2019, macOS Monterey/Big Sur/Catalina, and Ubuntu 22.04/20.04/18.04)
* [Docker container (Ubuntu)](https://hub.docker.com/_/ubuntu) / requires `openssh-client` package; `apt install -y openssh-client`
* [Docker container (CentOS)](https://hub.docker.com/_/centos) / requires `openssh-clients` package; `yum install -y openssh-clients`
* [Docker container (CentOS)](https://quay.io/repository/centos/centos) / requires `openssh-clients` package; `yum install -y openssh-clients`
* [Docker container (Alpine Linux)](https://hub.docker.com/_/alpine) / requires `openssh-client` package; `apk add openssh-client`
## Usage
@ -39,12 +39,14 @@ steps:
known_hosts: ${{ secrets.KNOWN_HOSTS }}
config: ${{ secrets.CONFIG }} # ssh_config; optional
if_key_exists: fail # replace / ignore / fail; optional (defaults to fail)
- name: rsync over ssh
run: rsync ./foo/ user@remote:bar/
- name: rsync over SSH
run: rsync -r ./foo/ user@remote:bar/
```
See [Workflow syntax for GitHub Actions](https://help.github.com/en/articles/workflow-syntax-for-github-actions) for details.
**NOTE:** Server key of `github.com` will be always set to `known_hosts`.
### Install multiple keys
If you want to install multiple keys, call this action multiple times.
@ -114,7 +116,7 @@ Here are some solutions:
I recommend **rsync via bastion**.
```bash
rsync -e "ssh bastion ssh" ./foo/ target:bar/
rsync -r -e "ssh bastion ssh" ./foo/ target:bar/
```
It has some advantages over other methods:

View file

@ -26,5 +26,5 @@ inputs:
required: false
default: "fail"
runs:
using: "node12"
using: "node16"
main: "lib/index.js"

File diff suppressed because it is too large Load diff

9397
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "install-ssh-key",
"version": "2.3.1",
"version": "2.4.0",
"private": true,
"description": "Install SSH key in .ssh",
"main": "lib/index.js",
@ -31,16 +31,16 @@
"author": "shimataro",
"license": "MIT",
"devDependencies": {
"@actions/core": "1.4.0",
"@types/node": "16.4.10",
"@typescript-eslint/eslint-plugin": "4.28.5",
"@typescript-eslint/parser": "4.28.5",
"@vercel/ncc": "0.29.0",
"eslint": "7.32.0",
"markdownlint-cli": "0.28.1",
"npm-check-updates": "11.8.3",
"@actions/core": "1.10.0",
"@types/node": "18.11.9",
"@typescript-eslint/eslint-plugin": "5.42.0",
"@typescript-eslint/parser": "5.42.0",
"@vercel/ncc": "0.34.0",
"eslint": "8.26.0",
"markdownlint-cli": "0.32.2",
"npm-check-updates": "16.3.16",
"npm-run-all": "4.1.5",
"typescript": "4.3.5",
"yaml-lint": "1.2.4"
"typescript": "4.8.4",
"yaml-lint": "1.7.0"
}
}

View file

@ -1,135 +0,0 @@
#!/bin/bash
# requires following packages:
# - git; I believe you have already installed.
# - sed; GNU sed is preferred. POSIX sed may not work.
# - perl; Already installed on most of unix system.
set -eu
BASE_BRANCH="develop"
PACKAGE_NAME="ssh-key-action"
URL_PRODUCT="https://github.com/shimataro/${PACKAGE_NAME}"
URL_REPOSITORY="${URL_PRODUCT}.git"
URL_COMPARE="${URL_PRODUCT}/compare"
URL_RELEASE="${URL_PRODUCT}/releases/new"
COLOR_ERROR="\e[1;41m"
COLOR_SECTION="\e[1;34m"
COLOR_COMMAND_NAME="\e[1;34m"
COLOR_OPTION="\e[4;36m"
COLOR_COMMAND="\e[4m"
COLOR_FILE="\e[1;34m"
COLOR_BRANCH="\e[1;31m"
COLOR_INPUT="\e[1;31m"
COLOR_SELECT="\e[1;32m"
COLOR_RESET="\e[m"
function main() {
cd $(dirname ${0})/..
if [ $# -lt 1 ]; then
usage
fi
local VERSION=$1
local BRANCH="release/v${VERSION}"
local TAG="v${VERSION}"
check_version_format ${VERSION}
check_current_branch
create_branch ${BRANCH}
./scripts/prepare-release.sh ${VERSION}
finish ${VERSION} ${BRANCH} ${TAG}
}
function usage() {
local COMMAND=`basename ${0}`
echo -e "${COLOR_SECTION}NAME${COLOR_RESET}
${COMMAND} - Create a branch and prepare for new release
${COLOR_SECTION}SYNOPSIS${COLOR_RESET}
${COLOR_COMMAND_NAME}${COMMAND}${COLOR_RESET} <${COLOR_OPTION}new-version${COLOR_RESET}>
${COLOR_SECTION}DESCRIPTION${COLOR_RESET}
This command:
- creates a new branch for release
- updates ${COLOR_FILE}CHANGELOG.md${COLOR_RESET}
- updates package version in ${COLOR_FILE}package.json${COLOR_RESET}
- updates dependencies version in ${COLOR_FILE}package.json${COLOR_RESET}
- verifies
- ...and commits!
${COLOR_OPTION}new-version${COLOR_RESET} must follow \"Semantic Versioning\" <https://semver.org/>.
"
exit 1
}
function check_version_format() {
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
return
fi
echo -e "${COLOR_ERROR}ERROR:${COLOR_RESET} Follow \"Semantic Versioning\" <https://semver.org/> for new version.
" >&2
exit 2
}
function check_current_branch() {
local CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ ${CURRENT_BRANCH} = ${BASE_BRANCH} ]; then
return
fi
echo -e "${COLOR_ERROR}ERROR:${COLOR_RESET} Work on ${COLOR_BRANCH}${BASE_BRANCH}${COLOR_RESET} branch
${COLOR_COMMAND}git checkout ${BASE_BRANCH}${COLOR_RESET}
" >&2
exit 2
}
function create_branch() {
local BRANCH=$1
git checkout -b ${BRANCH} ${BASE_BRANCH}
}
function finish() {
local VERSION=$1
local BRANCH=$2
local TAG=$3
local TARGET_BRANCH="v${VERSION%%[!0-9]*}"
local UPSTREAM="origin"
local CHANGELOG=$(git diff ${UPSTREAM}/${TARGET_BRANCH} ${BRANCH} CHANGELOG.md | sed -e "/^[^+]/d" -e "s/^\+\(.*\)$/\1/" -e "/^## /d" -e "/^\+/d" -e "/^\[/d" -e "s/\s/%20/g" -e "s/#/%23/g" -e 's/\n//g' | perl -pe "s/\n/%0A/g" | perl -pe "s/^(%0A)+//" | perl -pe "s/(%0A)+$//")
echo -e "
Branch ${COLOR_BRANCH}${BRANCH}${COLOR_RESET} has been created.
Remaining processes are...
1. Make sure all changes are correct
${COLOR_COMMAND}git diff ${BASE_BRANCH} ${BRANCH}${COLOR_RESET}
2. Push to remote ${UPSTREAM}
${COLOR_COMMAND}git push --set-upstream ${UPSTREAM} ${BRANCH}${COLOR_RESET}
3. Create a pull-request: ${COLOR_BRANCH}${BRANCH}${COLOR_RESET} to ${COLOR_BRANCH}${BASE_BRANCH}${COLOR_RESET}
${URL_COMPARE}/${BASE_BRANCH}...${BRANCH}?expand=1
select ${COLOR_SELECT}Squash and merge${COLOR_RESET}
4. Create a pull-request: ${COLOR_BRANCH}${BASE_BRANCH}${COLOR_RESET} to ${COLOR_BRANCH}${TARGET_BRANCH}${COLOR_RESET}
${URL_COMPARE}/${TARGET_BRANCH}...${BASE_BRANCH}?expand=1&title=version%20${VERSION}&body=${CHANGELOG}
select ${COLOR_SELECT}Create a merge commit${COLOR_RESET}
5. Create a new release
${URL_RELEASE}?tag=${TAG}&target=${TARGET_BRANCH}&title=${PACKAGE_NAME}%20${VERSION}%20released&body=${CHANGELOG}
Tag version: ${COLOR_INPUT}${TAG}${COLOR_RESET}
Target: ${COLOR_INPUT}${TARGET_BRANCH}${COLOR_RESET}
Release title: ${COLOR_INPUT}${PACKAGE_NAME} ${VERSION} released${COLOR_RESET}
Description this release: (copy and paste CHANGELOG.md)
6. Post processing
${COLOR_COMMAND}git checkout ${BASE_BRANCH}${COLOR_RESET}
${COLOR_COMMAND}git pull${COLOR_RESET}
${COLOR_COMMAND}git fetch -p${COLOR_RESET}
${COLOR_COMMAND}git branch -D ${BRANCH}${COLOR_RESET}
That's all!
"
}
main "$@"

View file

@ -1,9 +1,18 @@
#!/bin/bash
# requires following packages:
# - git; I believe it's already installed.
# - git; I believe you have already installed.
# - sed; GNU sed is preferred. POSIX sed may not work.
# - perl; Already installed on most of unix system.
set -eu
BASE_BRANCH="develop"
PACKAGE_NAME="ssh-key-action"
URL_PRODUCT="https://github.com/shimataro/${PACKAGE_NAME}"
URL_REPOSITORY="${URL_PRODUCT}.git"
URL_COMPARE="${URL_PRODUCT}/compare"
URL_RELEASE="${URL_PRODUCT}/releases/new"
COLOR_ERROR="\e[1;41m"
COLOR_SECTION="\e[1;34m"
COLOR_COMMAND_NAME="\e[1;34m"
@ -16,34 +25,39 @@ COLOR_SELECT="\e[1;32m"
COLOR_RESET="\e[m"
function main() {
cd $(dirname ${0})/..
if [ $# -lt 1 ]; then
usage
fi
cd $(dirname ${0})/..
local VERSION=$1
check_version_format ${VERSION}
local BRANCH="release/v${VERSION}"
local TAG="v${VERSION}"
check_version_format ${VERSION}
check_current_branch
create_branch ${BRANCH}
update_changelog ${VERSION}
update_package_version ${VERSION}
update_dependencies_version
regenerate_package_lock
build_package
commit_changes ${VERSION}
finish ${VERSION} ${BRANCH} ${TAG}
}
function usage() {
local COMMAND=`basename ${0}`
echo -e "${COLOR_SECTION}NAME${COLOR_RESET}
${COMMAND} - Prepare for new release
${COMMAND} - Create a branch and prepare for new release
${COLOR_SECTION}SYNOPSIS${COLOR_RESET}
${COLOR_COMMAND_NAME}${COMMAND}${COLOR_RESET} <${COLOR_OPTION}new-version${COLOR_RESET}>
${COLOR_SECTION}DESCRIPTION${COLOR_RESET}
This command:
- creates a new branch for release
- updates ${COLOR_FILE}CHANGELOG.md${COLOR_RESET}
- updates package version in ${COLOR_FILE}package.json${COLOR_RESET}
- updates dependencies version in ${COLOR_FILE}package.json${COLOR_RESET}
@ -65,6 +79,24 @@ function check_version_format() {
exit 2
}
function check_current_branch() {
local CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ ${CURRENT_BRANCH} = ${BASE_BRANCH} ]; then
return
fi
echo -e "${COLOR_ERROR}ERROR:${COLOR_RESET} Work on ${COLOR_BRANCH}${BASE_BRANCH}${COLOR_RESET} branch
${COLOR_COMMAND}git checkout ${BASE_BRANCH}${COLOR_RESET}
" >&2
exit 2
}
function create_branch() {
local BRANCH=$1
git checkout -b ${BRANCH} ${BASE_BRANCH}
}
function update_changelog() {
local VERSION=$1
local DATE=`date "+%Y-%m-%d"`
@ -79,19 +111,8 @@ function update_changelog() {
function update_package_version() {
local VERSION=$1
sed -i".bak" -r \
-e "s/(\"version\"\s*:\s*)\".*?\"/\1\"${VERSION}\"/" \
package.json
}
function update_dependencies_version() {
npm ci
npm run check-updates -- -u
}
function regenerate_package_lock() {
rm -rf package-lock.json node_modules
npm install
# update package.json
npm version --no-git-tag-version ${VERSION}
}
function build_package() {
@ -102,10 +123,46 @@ function build_package() {
function commit_changes() {
local VERSION=$1
rm -rf node_modules
npm ci --only=production
git add CHANGELOG.md package.json package-lock.json lib
git add .
git commit -m "version ${VERSION}"
}
function finish() {
local VERSION=$1
local BRANCH=$2
local TAG=$3
local TARGET_BRANCH="v${VERSION%%[!0-9]*}"
local UPSTREAM="origin"
local CHANGELOG=$(git diff ${UPSTREAM}/${TARGET_BRANCH} ${BRANCH} CHANGELOG.md | sed -e "/^[^+]/d" -e "s/^\+\(.*\)$/\1/" -e "/^## /d" -e "/^\+/d" -e "/^\[/d" -e "s/\s/%20/g" -e "s/#/%23/g" -e 's/\n//g' | perl -pe "s/\n/%0A/g" | perl -pe "s/^(%0A)+//" | perl -pe "s/(%0A)+$//")
echo -e "
Branch ${COLOR_BRANCH}${BRANCH}${COLOR_RESET} has been created.
Remaining processes are...
1. Make sure all changes are correct
${COLOR_COMMAND}git diff ${BASE_BRANCH} ${BRANCH}${COLOR_RESET}
2. Push to remote ${UPSTREAM}
${COLOR_COMMAND}git push --set-upstream ${UPSTREAM} ${BRANCH}${COLOR_RESET}
3. Create a pull-request: ${COLOR_BRANCH}${BRANCH}${COLOR_RESET} to ${COLOR_BRANCH}${BASE_BRANCH}${COLOR_RESET}
${URL_COMPARE}/${BASE_BRANCH}...${BRANCH}?expand=1
select ${COLOR_SELECT}Squash and merge${COLOR_RESET}
4. Create a pull-request: ${COLOR_BRANCH}${BASE_BRANCH}${COLOR_RESET} to ${COLOR_BRANCH}${TARGET_BRANCH}${COLOR_RESET}
${URL_COMPARE}/${TARGET_BRANCH}...${BASE_BRANCH}?expand=1&title=version%20${VERSION}&body=${CHANGELOG}
select ${COLOR_SELECT}Create a merge commit${COLOR_RESET}
5. Create a new release
${URL_RELEASE}?tag=${TAG}&target=${TARGET_BRANCH}&title=${PACKAGE_NAME}%20${VERSION}%20released&body=${CHANGELOG}
Tag version: ${COLOR_INPUT}${TAG}${COLOR_RESET}
Target: ${COLOR_INPUT}${TARGET_BRANCH}${COLOR_RESET}
Release title: ${COLOR_INPUT}${PACKAGE_NAME} ${VERSION} released${COLOR_RESET}
Description this release: (copy and paste CHANGELOG.md)
6. Post processing
${COLOR_COMMAND}git checkout ${BASE_BRANCH}${COLOR_RESET}
${COLOR_COMMAND}git pull${COLOR_RESET}
${COLOR_COMMAND}git fetch -p${COLOR_RESET}
${COLOR_COMMAND}git branch -D ${BRANCH}${COLOR_RESET}
That's all!
"
}
main "$@"

View file

@ -18,6 +18,7 @@ npm run check-updates -- -u
# re-install packages
rm -rf package-lock.json node_modules
npm i
npm dedupe
# check
npm run build

View file

@ -3,126 +3,128 @@ import path from "path";
import * as core from "@actions/core";
interface FileInfo
{
name: string;
contents: string;
options: fs.WriteFileOptions;
interface FileInfo {
name: string;
contents: string;
options: fs.WriteFileOptions;
}
const KNOWN_HOSTS = [
"github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==",
];
try {
main();
} catch (err) {
if (err instanceof Error) {
core.setFailed(err);
}
}
/**
* main function
*/
function main(): void
{
try
{
// parameters
const key = core.getInput("key", {
required: true,
});
const name = core.getInput("name");
const knownHosts = core.getInput("known_hosts", {
required: true,
});
const config = core.getInput("config");
const ifKeyExists = core.getInput("if_key_exists");
function main(): void {
// parameters
const key = core.getInput("key", {
required: true,
});
const name = core.getInput("name");
const knownHosts = core.getInput("known_hosts", {
required: true,
});
const config = core.getInput("config");
const ifKeyExists = core.getInput("if_key_exists");
// create ".ssh" directory
const home = getHomeDirectory();
const dirName = path.resolve(home, ".ssh");
fs.mkdirSync(dirName, {
recursive: true,
mode: 0o700,
});
// create ".ssh" directory
const sshDirName = createSshDirectory();
// files to be created
const files: FileInfo[] = [];
if(shouldCreateKeyFile(path.join(dirName, name), ifKeyExists))
{
files.push({
name: name,
contents: insertLf(key, false, true),
options: {
mode: 0o400,
flag: "wx",
},
});
}
if(knownHosts !== "unnecessary")
{
files.push({
name: "known_hosts",
contents: insertLf(knownHosts, true, true),
options: {
mode: 0o644,
flag: "a",
},
});
}
if(config !== "")
{
files.push({
name: "config",
contents: insertLf(config, true, true),
options: {
mode: 0o644,
flag: "a",
},
});
}
// files to be created
const files: FileInfo[] = [
{
name: "known_hosts",
contents: insertLf(buildKnownHostsArray(knownHosts).join("\n"), true, true),
options: {
mode: 0o644,
flag: "a",
},
},
];
if (shouldCreateKeyFile(path.join(sshDirName, name), ifKeyExists)) {
files.push({
name: name,
contents: insertLf(key, false, true),
options: {
mode: 0o400,
flag: "wx",
},
});
}
if (config !== "") {
files.push({
name: "config",
contents: insertLf(config, true, true),
options: {
mode: 0o644,
flag: "a",
},
});
}
// create files
for(const file of files)
{
const fileName = path.join(dirName, file.name);
fs.writeFileSync(fileName, file.contents, file.options);
}
// create files
for (const file of files) {
const fileName = path.join(sshDirName, file.name);
fs.writeFileSync(fileName, file.contents, file.options);
}
console.log(`SSH key has been stored to ${dirName} successfully.`);
}
catch(err)
{
core.setFailed(err.message);
}
console.log(`SSH key has been stored to ${sshDirName} successfully.`);
}
/**
* create ".ssh" directory
* @returns directory name
*/
function createSshDirectory(): string {
const home = getHomeDirectory();
const dirName = path.resolve(home, ".ssh");
fs.mkdirSync(dirName, {
recursive: true,
mode: 0o700,
});
return dirName;
}
/**
* get home directory
* @returns home directory
* @returns home directory name
*/
function getHomeDirectory(): string
{
const homeEnv = getHomeEnv();
const home = process.env[homeEnv];
if(home === undefined)
{
throw Error(`${homeEnv} is not defined`);
}
function getHomeDirectory(): string {
const homeEnv = getHomeEnv();
const home = process.env[homeEnv];
if (home === undefined) {
throw Error(`${homeEnv} is not defined`);
}
if(home === "/github/home")
{
// Docker container
return "/root";
}
if (home === "/github/home") {
// Docker container
return "/root";
}
return home;
return home;
}
/**
* get HOME environment name
* @returns HOME environment name
*/
function getHomeEnv(): string
{
if(process.platform === "win32")
{
// Windows
return "USERPROFILE";
}
function getHomeEnv(): string {
if (process.platform === "win32") {
// Windows
return "USERPROFILE";
}
// macOS / Linux
return "HOME";
// macOS / Linux
return "HOME";
}
/**
@ -132,25 +134,21 @@ function getHomeEnv(): string
* @param append true to append
* @returns new value
*/
function insertLf(value: string, prepend: boolean, append: boolean): string
{
let affectedValue = value;
function insertLf(value: string, prepend: boolean, append: boolean): string {
let affectedValue = value;
if(value.length === 0)
{
// do nothing if empty
return "";
}
if(prepend && !affectedValue.startsWith("\n"))
{
affectedValue = `\n${affectedValue}`;
}
if(append && !affectedValue.endsWith("\n"))
{
affectedValue = `${affectedValue}\n`;
}
if (value.length === 0) {
// do nothing if empty
return "";
}
if (prepend && !affectedValue.startsWith("\n")) {
affectedValue = `\n${affectedValue}`;
}
if (append && !affectedValue.endsWith("\n")) {
affectedValue = `${affectedValue}\n`;
}
return affectedValue;
return affectedValue;
}
/**
@ -159,29 +157,36 @@ function insertLf(value: string, prepend: boolean, append: boolean): string
* @param ifKeyExists action if SSH key exists
* @returns Yes/No
*/
function shouldCreateKeyFile(keyFilePath: string, ifKeyExists: string): boolean
{
if(!fs.existsSync(keyFilePath))
{
// should create if file does not exist
return true;
}
function shouldCreateKeyFile(keyFilePath: string, ifKeyExists: string): boolean {
if (!fs.existsSync(keyFilePath)) {
// should create if file does not exist
return true;
}
switch(ifKeyExists)
{
case "replace":
// remove file and should create if replace
fs.unlinkSync(keyFilePath);
return true;
switch (ifKeyExists) {
case "replace":
// remove file and should create if replace
fs.unlinkSync(keyFilePath);
return true;
case "ignore":
// should NOT create if ignore
return false;
case "ignore":
// should NOT create if ignore
return false;
default:
// error otherwise
throw new Error(`SSH key is already installed. Set "if_key_exists" to "replace" or "ignore" in order to avoid this error.`);
}
default:
// error otherwise
throw new Error(`SSH key is already installed. Set "if_key_exists" to "replace" or "ignore" in order to avoid this error.`);
}
}
main();
/**
* build array of known_hosts
* @param knownHosts known_hosts
* @returns array of known_hosts
*/
function buildKnownHostsArray(knownHosts: string): string[] {
if (knownHosts === "unnecessary") {
return KNOWN_HOSTS;
}
return KNOWN_HOSTS.concat(knownHosts);
}