mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
commit
86a65fd09b
20 changed files with 10724 additions and 2890 deletions
|
@ -25,6 +25,13 @@ spaces_around_brackets = none
|
||||||
indent_brace_style = allman
|
indent_brace_style = allman
|
||||||
|
|
||||||
|
|
||||||
|
# JavaScript/TypeScript
|
||||||
|
[*.{js,ts}]
|
||||||
|
indent_style = space
|
||||||
|
curly_bracket_next_line = false
|
||||||
|
indent_brace_style = K&R
|
||||||
|
|
||||||
|
|
||||||
# JSON/YAML
|
# JSON/YAML
|
||||||
[*.{json,babelrc,code-workspace,yml,yaml}]
|
[*.{json,babelrc,code-workspace,yml,yaml}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
|
@ -14,7 +14,9 @@ parserOptions:
|
||||||
project: ./tsconfig.json
|
project: ./tsconfig.json
|
||||||
rules: # https://eslint.org/docs/rules/
|
rules: # https://eslint.org/docs/rules/
|
||||||
accessor-pairs: error
|
accessor-pairs: error
|
||||||
array-bracket-newline: error
|
array-bracket-newline:
|
||||||
|
- error
|
||||||
|
- consistent
|
||||||
array-bracket-spacing:
|
array-bracket-spacing:
|
||||||
- error
|
- error
|
||||||
- never
|
- never
|
||||||
|
@ -29,9 +31,7 @@ rules: # https://eslint.org/docs/rules/
|
||||||
before: true
|
before: true
|
||||||
block-scoped-var: error
|
block-scoped-var: error
|
||||||
block-spacing: error
|
block-spacing: error
|
||||||
brace-style:
|
brace-style: 'off' # see "@typescript-eslint/brace-style"
|
||||||
- error
|
|
||||||
- allman
|
|
||||||
callback-return: error
|
callback-return: error
|
||||||
capitalized-comments: 'off'
|
capitalized-comments: 'off'
|
||||||
class-methods-use-this: error
|
class-methods-use-this: error
|
||||||
|
@ -87,26 +87,14 @@ rules: # https://eslint.org/docs/rules/
|
||||||
- below
|
- below
|
||||||
indent:
|
indent:
|
||||||
- error
|
- error
|
||||||
- tab
|
- 4
|
||||||
|
- SwitchCase: 1
|
||||||
indent-legacy: 'off'
|
indent-legacy: 'off'
|
||||||
init-declarations: error
|
init-declarations: error
|
||||||
jsx-quotes: error
|
jsx-quotes: error
|
||||||
key-spacing: error
|
key-spacing: error
|
||||||
keyword-spacing:
|
keyword-spacing:
|
||||||
- error
|
- error
|
||||||
- overrides:
|
|
||||||
catch:
|
|
||||||
after: false
|
|
||||||
for:
|
|
||||||
after: false
|
|
||||||
if:
|
|
||||||
after: false
|
|
||||||
switch:
|
|
||||||
after: false
|
|
||||||
while:
|
|
||||||
after: false
|
|
||||||
with:
|
|
||||||
after: false
|
|
||||||
line-comment-position: 'off'
|
line-comment-position: 'off'
|
||||||
linebreak-style:
|
linebreak-style:
|
||||||
- error
|
- error
|
||||||
|
@ -256,7 +244,7 @@ rules: # https://eslint.org/docs/rules/
|
||||||
rest-spread-spacing:
|
rest-spread-spacing:
|
||||||
- error
|
- error
|
||||||
- never
|
- never
|
||||||
semi: error
|
semi: 'off' # see "@typescript-eslint/semi"
|
||||||
semi-spacing: error
|
semi-spacing: error
|
||||||
semi-style:
|
semi-style:
|
||||||
- error
|
- error
|
||||||
|
@ -308,8 +296,25 @@ rules: # https://eslint.org/docs/rules/
|
||||||
|
|
||||||
# @typescript-eslint plugin
|
# @typescript-eslint plugin
|
||||||
"@typescript-eslint/ban-ts-ignore": 'off'
|
"@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-empty-interface": 'off'
|
||||||
|
"@typescript-eslint/no-floating-promises": error
|
||||||
"@typescript-eslint/no-use-before-define":
|
"@typescript-eslint/no-use-before-define":
|
||||||
- error
|
- error
|
||||||
- functions: false
|
- functions: false
|
||||||
"@typescript-eslint/strict-boolean-expressions": error
|
"@typescript-eslint/semi": error
|
||||||
|
"@typescript-eslint/strict-boolean-expressions":
|
||||||
|
- error
|
||||||
|
- allowString: false
|
||||||
|
allowNumber: false
|
||||||
|
allowNullableObject: false
|
||||||
|
|
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
|
@ -13,12 +13,15 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- Windows-2019
|
- Windows-2019
|
||||||
|
- Windows-2022
|
||||||
- macOS-10.15
|
- macOS-10.15
|
||||||
- Ubuntu-16.04
|
- macOS-11
|
||||||
|
- macOS-12
|
||||||
- Ubuntu-18.04
|
- Ubuntu-18.04
|
||||||
- Ubuntu-20.04
|
- Ubuntu-20.04
|
||||||
|
- Ubuntu-22.04
|
||||||
nodejs:
|
nodejs:
|
||||||
- 12
|
- 16
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Turn off auto-crlf
|
- name: Turn off auto-crlf
|
||||||
|
|
154
.github/workflows/verify-on-container-alpine.yml
vendored
154
.github/workflows/verify-on-container-alpine.yml
vendored
|
@ -15,6 +15,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -30,11 +31,42 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-pkcs8:
|
||||||
name: Connect to github.com (PKCS8 format)
|
name: Connect to github.com (PKCS8 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -44,6 +76,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -59,11 +92,42 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-rfc4716:
|
||||||
name: Connect to github.com (RFC4716 format)
|
name: Connect to github.com (RFC4716 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -73,6 +137,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -88,11 +153,42 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
key_if_exists_replace-key_exists:
|
||||||
name: if_key_exists=replace / key exists
|
name: if_key_exists=replace / key exists
|
||||||
|
@ -104,6 +200,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -118,12 +215,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # replaced
|
key: "dummy" # replaced
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -139,6 +236,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -153,7 +251,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -170,6 +268,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -184,12 +283,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -205,6 +304,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -219,7 +319,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -236,6 +336,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -250,12 +351,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: print created files
|
- name: print created files
|
||||||
|
@ -272,6 +373,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- alpine:3.10
|
- alpine:3.10
|
||||||
- alpine:3.11
|
- alpine:3.11
|
||||||
|
@ -286,37 +388,9 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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
|
|
||||||
|
|
186
.github/workflows/verify-on-container-centos.yml
vendored
186
.github/workflows/verify-on-container-centos.yml
vendored
|
@ -15,9 +15,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
@ -29,11 +30,41 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-pkcs8:
|
||||||
name: Connect to github.com (PKCS8 format)
|
name: Connect to github.com (PKCS8 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -43,9 +74,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
@ -57,11 +89,41 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-rfc4716:
|
||||||
name: Connect to github.com (RFC4716 format)
|
name: Connect to github.com (RFC4716 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -71,9 +133,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
@ -85,11 +148,41 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
key_if_exists_replace-key_exists:
|
||||||
name: if_key_exists=replace / key exists
|
name: if_key_exists=replace / key exists
|
||||||
|
@ -101,9 +194,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -114,12 +208,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # replaced
|
key: "dummy" # replaced
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -135,9 +229,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -148,7 +243,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -165,9 +260,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -178,12 +274,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -199,9 +295,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -212,7 +309,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -229,9 +326,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -242,12 +340,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: print created files
|
- name: print created files
|
||||||
|
@ -264,9 +362,10 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- centos:7
|
- quay.io/centos/centos:centos7
|
||||||
- centos:8
|
- quay.io/centos/centos:stream8
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -277,36 +376,9 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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
|
|
||||||
|
|
170
.github/workflows/verify-on-container-ubuntu.yml
vendored
170
.github/workflows/verify-on-container-ubuntu.yml
vendored
|
@ -15,10 +15,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
@ -31,11 +33,44 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-pkcs8:
|
||||||
name: Connect to github.com (PKCS8 format)
|
name: Connect to github.com (PKCS8 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -45,10 +80,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
@ -61,11 +98,44 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-rfc4716:
|
||||||
name: Connect to github.com (RFC4716 format)
|
name: Connect to github.com (RFC4716 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -75,10 +145,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
@ -91,11 +163,44 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
key_if_exists_replace-key_exists:
|
||||||
name: if_key_exists=replace / key exists
|
name: if_key_exists=replace / key exists
|
||||||
|
@ -107,10 +212,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -122,12 +229,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # replaced
|
key: "dummy" # replaced
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -143,10 +250,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -158,7 +267,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -175,10 +284,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -190,12 +301,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -211,10 +322,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -226,7 +339,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
|
@ -243,10 +356,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -258,12 +373,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: print created files
|
- name: print created files
|
||||||
|
@ -280,10 +395,12 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
container:
|
container:
|
||||||
- ubuntu:16.04
|
- ubuntu:16.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
|
- ubuntu:22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -295,38 +412,9 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l /root/.ssh
|
run: ls -l /root/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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
|
|
||||||
|
|
135
.github/workflows/verify-on-macos.yml
vendored
135
.github/workflows/verify-on-macos.yml
vendored
|
@ -14,6 +14,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -21,11 +23,34 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-pkcs8:
|
||||||
name: Connect to github.com (PKCS8 format)
|
name: Connect to github.com (PKCS8 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -34,6 +59,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -41,11 +68,34 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-rfc4716:
|
||||||
name: Connect to github.com (RFC4716 format)
|
name: Connect to github.com (RFC4716 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -54,6 +104,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -61,11 +113,35 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-with-name:
|
||||||
name: Connect to github.com with name and config
|
name: Connect to github.com with name and config
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -74,6 +150,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -81,7 +159,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
name: ssh_key_name # optional
|
name: ssh_key_name # optional
|
||||||
config: | # optional
|
config: | # optional
|
||||||
Host github
|
Host github
|
||||||
|
@ -101,6 +179,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -108,12 +188,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # replaced
|
key: "dummy" # replaced
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -127,6 +207,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -134,7 +216,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -149,6 +231,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -156,12 +240,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -175,6 +259,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -182,7 +268,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -197,6 +283,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -204,12 +292,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: print created files
|
- name: print created files
|
||||||
|
@ -224,6 +312,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- macos-10.15
|
- macos-10.15
|
||||||
|
- macos-11
|
||||||
|
- macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -231,28 +321,9 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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
|
|
||||||
|
|
126
.github/workflows/verify-on-ubuntu.yml
vendored
126
.github/workflows/verify-on-ubuntu.yml
vendored
|
@ -15,6 +15,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -22,11 +23,34 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-pkcs8:
|
||||||
name: Connect to github.com (PKCS8 format)
|
name: Connect to github.com (PKCS8 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -36,6 +60,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -43,11 +68,34 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-rfc4716:
|
||||||
name: Connect to github.com (RFC4716 format)
|
name: Connect to github.com (RFC4716 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -57,6 +105,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -64,11 +113,35 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-with-name:
|
||||||
name: Connect to github.com with name and config
|
name: Connect to github.com with name and config
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -78,6 +151,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -85,7 +159,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
name: ssh_key_name # optional
|
name: ssh_key_name # optional
|
||||||
config: | # optional
|
config: | # optional
|
||||||
Host github
|
Host github
|
||||||
|
@ -106,6 +180,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -113,12 +188,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # replaced
|
key: "dummy" # replaced
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -133,6 +208,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -140,7 +216,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -156,6 +232,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -163,12 +240,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -183,6 +260,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -190,7 +268,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
|
@ -206,6 +284,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -213,12 +292,12 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: print created files
|
- name: print created files
|
||||||
|
@ -234,6 +313,7 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-18.04
|
- ubuntu-18.04
|
||||||
- ubuntu-20.04
|
- ubuntu-20.04
|
||||||
|
- ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -241,29 +321,9 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls -l ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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
|
|
||||||
|
|
147
.github/workflows/verify-on-windows.yml
vendored
147
.github/workflows/verify-on-windows.yml
vendored
|
@ -13,8 +13,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -22,11 +22,33 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-pkcs8:
|
||||||
name: Connect to github.com (PKCS8 format)
|
name: Connect to github.com (PKCS8 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -34,8 +56,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -43,11 +65,33 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-rfc4716:
|
||||||
name: Connect to github.com (RFC4716 format)
|
name: Connect to github.com (RFC4716 format)
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -55,8 +99,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -64,11 +108,34 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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:
|
ssh-with-name:
|
||||||
name: Connect to github.com with name and config
|
name: Connect to github.com with name and config
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -76,8 +143,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -85,7 +152,7 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
name: ssh_key_name # optional
|
name: ssh_key_name # optional
|
||||||
config: | # optional
|
config: | # optional
|
||||||
Host github
|
Host github
|
||||||
|
@ -93,7 +160,7 @@ jobs:
|
||||||
User git
|
User git
|
||||||
IdentityFile ~/.ssh/ssh_key_name
|
IdentityFile ~/.ssh/ssh_key_name
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone github:shimataro/ssh-key-action.git tmp
|
run: git clone github:shimataro/ssh-key-action.git tmp
|
||||||
|
|
||||||
|
@ -104,8 +171,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -113,15 +180,15 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # replaced
|
key: "dummy" # replaced
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||||
key_if_exists_replace-key_doesnt_exist:
|
key_if_exists_replace-key_doesnt_exist:
|
||||||
|
@ -131,8 +198,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -140,10 +207,10 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: replace
|
if_key_exists: replace
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||||
|
|
||||||
|
@ -154,8 +221,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -163,15 +230,15 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||||
key_if_exists_ignore-key_doesnt_exist:
|
key_if_exists_ignore-key_doesnt_exist:
|
||||||
|
@ -181,8 +248,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -190,10 +257,10 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: ignore
|
if_key_exists: ignore
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||||
|
|
||||||
|
@ -204,8 +271,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -213,16 +280,16 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
- name: Install SSH key (replace)
|
- name: Install SSH key (replace)
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: "dummy" # ignored
|
key: "dummy" # ignored
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||||
key_if_exists_fail-key_doesnt_exist:
|
key_if_exists_fail-key_doesnt_exist:
|
||||||
|
@ -232,8 +299,8 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- windows-2016
|
|
||||||
- windows-2019
|
- windows-2019
|
||||||
|
- windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source codes
|
- name: Checkout source codes
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -241,29 +308,9 @@ jobs:
|
||||||
uses: ./.
|
uses: ./.
|
||||||
with:
|
with:
|
||||||
key: ${{ secrets.SSH_KEY_PEM }}
|
key: ${{ secrets.SSH_KEY_PEM }}
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: unnecessary
|
||||||
if_key_exists: fail
|
if_key_exists: fail
|
||||||
- name: print created files
|
- name: print created files
|
||||||
run: ls -l ~/.ssh
|
run: ls ~/.ssh
|
||||||
- name: git clone through SSH
|
- name: git clone through SSH
|
||||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
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
3
.gitignore
vendored
|
@ -13,5 +13,8 @@ Thumbs.db
|
||||||
*.orig
|
*.orig
|
||||||
*.rej
|
*.rej
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
/.idea/
|
||||||
|
|
||||||
# Node.js modules
|
# Node.js modules
|
||||||
/node_modules/
|
/node_modules/
|
||||||
|
|
20
CHANGELOG.md
20
CHANGELOG.md
|
@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## [2.3.1] - 2021-08-01
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
@ -157,7 +174,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
* First release.
|
* 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.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.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
|
[2.2.0]: https://github.com/shimataro/ssh-key-action/compare/v2.1.0...v2.2.0
|
||||||
|
|
12
README.md
12
README.md
|
@ -17,9 +17,9 @@ Useful for SCP, SFTP, and `rsync` over SSH in deployment script.
|
||||||
|
|
||||||
tested on:
|
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 (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`
|
* [Docker container (Alpine Linux)](https://hub.docker.com/_/alpine) / requires `openssh-client` package; `apk add openssh-client`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -39,12 +39,14 @@ steps:
|
||||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||||
config: ${{ secrets.CONFIG }} # ssh_config; optional
|
config: ${{ secrets.CONFIG }} # ssh_config; optional
|
||||||
if_key_exists: fail # replace / ignore / fail; optional (defaults to fail)
|
if_key_exists: fail # replace / ignore / fail; optional (defaults to fail)
|
||||||
- name: rsync over ssh
|
- name: rsync over SSH
|
||||||
run: rsync ./foo/ user@remote:bar/
|
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.
|
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
|
### Install multiple keys
|
||||||
|
|
||||||
If you want to install multiple keys, call this action multiple times.
|
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**.
|
I recommend **rsync via bastion**.
|
||||||
|
|
||||||
```bash
|
```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:
|
It has some advantages over other methods:
|
||||||
|
|
|
@ -26,5 +26,5 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: "fail"
|
default: "fail"
|
||||||
runs:
|
runs:
|
||||||
using: "node12"
|
using: "node16"
|
||||||
main: "lib/index.js"
|
main: "lib/index.js"
|
||||||
|
|
2667
lib/index.js
2667
lib/index.js
File diff suppressed because it is too large
Load diff
9397
package-lock.json
generated
9397
package-lock.json
generated
File diff suppressed because it is too large
Load diff
22
package.json
22
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "install-ssh-key",
|
"name": "install-ssh-key",
|
||||||
"version": "2.3.1",
|
"version": "2.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Install SSH key in .ssh",
|
"description": "Install SSH key in .ssh",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
|
@ -31,16 +31,16 @@
|
||||||
"author": "shimataro",
|
"author": "shimataro",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@actions/core": "1.4.0",
|
"@actions/core": "1.10.0",
|
||||||
"@types/node": "16.4.10",
|
"@types/node": "18.11.9",
|
||||||
"@typescript-eslint/eslint-plugin": "4.28.5",
|
"@typescript-eslint/eslint-plugin": "5.42.0",
|
||||||
"@typescript-eslint/parser": "4.28.5",
|
"@typescript-eslint/parser": "5.42.0",
|
||||||
"@vercel/ncc": "0.29.0",
|
"@vercel/ncc": "0.34.0",
|
||||||
"eslint": "7.32.0",
|
"eslint": "8.26.0",
|
||||||
"markdownlint-cli": "0.28.1",
|
"markdownlint-cli": "0.32.2",
|
||||||
"npm-check-updates": "11.8.3",
|
"npm-check-updates": "16.3.16",
|
||||||
"npm-run-all": "4.1.5",
|
"npm-run-all": "4.1.5",
|
||||||
"typescript": "4.3.5",
|
"typescript": "4.8.4",
|
||||||
"yaml-lint": "1.2.4"
|
"yaml-lint": "1.7.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 "$@"
|
|
|
@ -1,9 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# requires following packages:
|
# 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.
|
# - sed; GNU sed is preferred. POSIX sed may not work.
|
||||||
|
# - perl; Already installed on most of unix system.
|
||||||
set -eu
|
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_ERROR="\e[1;41m"
|
||||||
COLOR_SECTION="\e[1;34m"
|
COLOR_SECTION="\e[1;34m"
|
||||||
COLOR_COMMAND_NAME="\e[1;34m"
|
COLOR_COMMAND_NAME="\e[1;34m"
|
||||||
|
@ -16,34 +25,39 @@ COLOR_SELECT="\e[1;32m"
|
||||||
COLOR_RESET="\e[m"
|
COLOR_RESET="\e[m"
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
cd $(dirname ${0})/..
|
||||||
|
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $(dirname ${0})/..
|
|
||||||
|
|
||||||
local VERSION=$1
|
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_changelog ${VERSION}
|
||||||
update_package_version ${VERSION}
|
update_package_version ${VERSION}
|
||||||
update_dependencies_version
|
|
||||||
regenerate_package_lock
|
|
||||||
build_package
|
build_package
|
||||||
commit_changes ${VERSION}
|
commit_changes ${VERSION}
|
||||||
|
finish ${VERSION} ${BRANCH} ${TAG}
|
||||||
}
|
}
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
local COMMAND=`basename ${0}`
|
local COMMAND=`basename ${0}`
|
||||||
|
|
||||||
echo -e "${COLOR_SECTION}NAME${COLOR_RESET}
|
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_SECTION}SYNOPSIS${COLOR_RESET}
|
||||||
${COLOR_COMMAND_NAME}${COMMAND}${COLOR_RESET} <${COLOR_OPTION}new-version${COLOR_RESET}>
|
${COLOR_COMMAND_NAME}${COMMAND}${COLOR_RESET} <${COLOR_OPTION}new-version${COLOR_RESET}>
|
||||||
|
|
||||||
${COLOR_SECTION}DESCRIPTION${COLOR_RESET}
|
${COLOR_SECTION}DESCRIPTION${COLOR_RESET}
|
||||||
This command:
|
This command:
|
||||||
|
- creates a new branch for release
|
||||||
- updates ${COLOR_FILE}CHANGELOG.md${COLOR_RESET}
|
- updates ${COLOR_FILE}CHANGELOG.md${COLOR_RESET}
|
||||||
- updates package version in ${COLOR_FILE}package.json${COLOR_RESET}
|
- updates package version in ${COLOR_FILE}package.json${COLOR_RESET}
|
||||||
- updates dependencies 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
|
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() {
|
function update_changelog() {
|
||||||
local VERSION=$1
|
local VERSION=$1
|
||||||
local DATE=`date "+%Y-%m-%d"`
|
local DATE=`date "+%Y-%m-%d"`
|
||||||
|
@ -79,19 +111,8 @@ function update_changelog() {
|
||||||
function update_package_version() {
|
function update_package_version() {
|
||||||
local VERSION=$1
|
local VERSION=$1
|
||||||
|
|
||||||
sed -i".bak" -r \
|
# update package.json
|
||||||
-e "s/(\"version\"\s*:\s*)\".*?\"/\1\"${VERSION}\"/" \
|
npm version --no-git-tag-version ${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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_package() {
|
function build_package() {
|
||||||
|
@ -102,10 +123,46 @@ function build_package() {
|
||||||
function commit_changes() {
|
function commit_changes() {
|
||||||
local VERSION=$1
|
local VERSION=$1
|
||||||
|
|
||||||
rm -rf node_modules
|
git add .
|
||||||
npm ci --only=production
|
|
||||||
git add CHANGELOG.md package.json package-lock.json lib
|
|
||||||
git commit -m "version ${VERSION}"
|
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 "$@"
|
main "$@"
|
||||||
|
|
|
@ -18,6 +18,7 @@ npm run check-updates -- -u
|
||||||
# re-install packages
|
# re-install packages
|
||||||
rm -rf package-lock.json node_modules
|
rm -rf package-lock.json node_modules
|
||||||
npm i
|
npm i
|
||||||
|
npm dedupe
|
||||||
|
|
||||||
# check
|
# check
|
||||||
npm run build
|
npm run build
|
||||||
|
|
275
src/main.ts
275
src/main.ts
|
@ -3,126 +3,128 @@ import path from "path";
|
||||||
|
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
interface FileInfo
|
interface FileInfo {
|
||||||
{
|
name: string;
|
||||||
name: string;
|
contents: string;
|
||||||
contents: string;
|
options: fs.WriteFileOptions;
|
||||||
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
|
* main function
|
||||||
*/
|
*/
|
||||||
function main(): void
|
function main(): void {
|
||||||
{
|
// parameters
|
||||||
try
|
const key = core.getInput("key", {
|
||||||
{
|
required: true,
|
||||||
// parameters
|
});
|
||||||
const key = core.getInput("key", {
|
const name = core.getInput("name");
|
||||||
required: true,
|
const knownHosts = core.getInput("known_hosts", {
|
||||||
});
|
required: true,
|
||||||
const name = core.getInput("name");
|
});
|
||||||
const knownHosts = core.getInput("known_hosts", {
|
const config = core.getInput("config");
|
||||||
required: true,
|
const ifKeyExists = core.getInput("if_key_exists");
|
||||||
});
|
|
||||||
const config = core.getInput("config");
|
|
||||||
const ifKeyExists = core.getInput("if_key_exists");
|
|
||||||
|
|
||||||
// create ".ssh" directory
|
// create ".ssh" directory
|
||||||
const home = getHomeDirectory();
|
const sshDirName = createSshDirectory();
|
||||||
const dirName = path.resolve(home, ".ssh");
|
|
||||||
fs.mkdirSync(dirName, {
|
|
||||||
recursive: true,
|
|
||||||
mode: 0o700,
|
|
||||||
});
|
|
||||||
|
|
||||||
// files to be created
|
// files to be created
|
||||||
const files: FileInfo[] = [];
|
const files: FileInfo[] = [
|
||||||
if(shouldCreateKeyFile(path.join(dirName, name), ifKeyExists))
|
{
|
||||||
{
|
name: "known_hosts",
|
||||||
files.push({
|
contents: insertLf(buildKnownHostsArray(knownHosts).join("\n"), true, true),
|
||||||
name: name,
|
options: {
|
||||||
contents: insertLf(key, false, true),
|
mode: 0o644,
|
||||||
options: {
|
flag: "a",
|
||||||
mode: 0o400,
|
},
|
||||||
flag: "wx",
|
},
|
||||||
},
|
];
|
||||||
});
|
if (shouldCreateKeyFile(path.join(sshDirName, name), ifKeyExists)) {
|
||||||
}
|
files.push({
|
||||||
if(knownHosts !== "unnecessary")
|
name: name,
|
||||||
{
|
contents: insertLf(key, false, true),
|
||||||
files.push({
|
options: {
|
||||||
name: "known_hosts",
|
mode: 0o400,
|
||||||
contents: insertLf(knownHosts, true, true),
|
flag: "wx",
|
||||||
options: {
|
},
|
||||||
mode: 0o644,
|
});
|
||||||
flag: "a",
|
}
|
||||||
},
|
if (config !== "") {
|
||||||
});
|
files.push({
|
||||||
}
|
name: "config",
|
||||||
if(config !== "")
|
contents: insertLf(config, true, true),
|
||||||
{
|
options: {
|
||||||
files.push({
|
mode: 0o644,
|
||||||
name: "config",
|
flag: "a",
|
||||||
contents: insertLf(config, true, true),
|
},
|
||||||
options: {
|
});
|
||||||
mode: 0o644,
|
}
|
||||||
flag: "a",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// create files
|
// create files
|
||||||
for(const file of files)
|
for (const file of files) {
|
||||||
{
|
const fileName = path.join(sshDirName, file.name);
|
||||||
const fileName = path.join(dirName, file.name);
|
fs.writeFileSync(fileName, file.contents, file.options);
|
||||||
fs.writeFileSync(fileName, file.contents, file.options);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`SSH key has been stored to ${dirName} successfully.`);
|
console.log(`SSH key has been stored to ${sshDirName} successfully.`);
|
||||||
}
|
}
|
||||||
catch(err)
|
|
||||||
{
|
/**
|
||||||
core.setFailed(err.message);
|
* 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
|
* get home directory
|
||||||
* @returns home directory
|
* @returns home directory name
|
||||||
*/
|
*/
|
||||||
function getHomeDirectory(): string
|
function getHomeDirectory(): string {
|
||||||
{
|
const homeEnv = getHomeEnv();
|
||||||
const homeEnv = getHomeEnv();
|
const home = process.env[homeEnv];
|
||||||
const home = process.env[homeEnv];
|
if (home === undefined) {
|
||||||
if(home === undefined)
|
throw Error(`${homeEnv} is not defined`);
|
||||||
{
|
}
|
||||||
throw Error(`${homeEnv} is not defined`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(home === "/github/home")
|
if (home === "/github/home") {
|
||||||
{
|
// Docker container
|
||||||
// Docker container
|
return "/root";
|
||||||
return "/root";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return home;
|
return home;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get HOME environment name
|
* get HOME environment name
|
||||||
* @returns HOME environment name
|
* @returns HOME environment name
|
||||||
*/
|
*/
|
||||||
function getHomeEnv(): string
|
function getHomeEnv(): string {
|
||||||
{
|
if (process.platform === "win32") {
|
||||||
if(process.platform === "win32")
|
// Windows
|
||||||
{
|
return "USERPROFILE";
|
||||||
// Windows
|
}
|
||||||
return "USERPROFILE";
|
|
||||||
}
|
|
||||||
|
|
||||||
// macOS / Linux
|
// macOS / Linux
|
||||||
return "HOME";
|
return "HOME";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,25 +134,21 @@ function getHomeEnv(): string
|
||||||
* @param append true to append
|
* @param append true to append
|
||||||
* @returns new value
|
* @returns new value
|
||||||
*/
|
*/
|
||||||
function insertLf(value: string, prepend: boolean, append: boolean): string
|
function insertLf(value: string, prepend: boolean, append: boolean): string {
|
||||||
{
|
let affectedValue = value;
|
||||||
let affectedValue = value;
|
|
||||||
|
|
||||||
if(value.length === 0)
|
if (value.length === 0) {
|
||||||
{
|
// do nothing if empty
|
||||||
// do nothing if empty
|
return "";
|
||||||
return "";
|
}
|
||||||
}
|
if (prepend && !affectedValue.startsWith("\n")) {
|
||||||
if(prepend && !affectedValue.startsWith("\n"))
|
affectedValue = `\n${affectedValue}`;
|
||||||
{
|
}
|
||||||
affectedValue = `\n${affectedValue}`;
|
if (append && !affectedValue.endsWith("\n")) {
|
||||||
}
|
affectedValue = `${affectedValue}\n`;
|
||||||
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
|
* @param ifKeyExists action if SSH key exists
|
||||||
* @returns Yes/No
|
* @returns Yes/No
|
||||||
*/
|
*/
|
||||||
function shouldCreateKeyFile(keyFilePath: string, ifKeyExists: string): boolean
|
function shouldCreateKeyFile(keyFilePath: string, ifKeyExists: string): boolean {
|
||||||
{
|
if (!fs.existsSync(keyFilePath)) {
|
||||||
if(!fs.existsSync(keyFilePath))
|
// should create if file does not exist
|
||||||
{
|
return true;
|
||||||
// should create if file does not exist
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(ifKeyExists)
|
switch (ifKeyExists) {
|
||||||
{
|
case "replace":
|
||||||
case "replace":
|
// remove file and should create if replace
|
||||||
// remove file and should create if replace
|
fs.unlinkSync(keyFilePath);
|
||||||
fs.unlinkSync(keyFilePath);
|
return true;
|
||||||
return true;
|
|
||||||
|
|
||||||
case "ignore":
|
case "ignore":
|
||||||
// should NOT create if ignore
|
// should NOT create if ignore
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// error otherwise
|
// error otherwise
|
||||||
throw new Error(`SSH key is already installed. Set "if_key_exists" to "replace" or "ignore" in order to avoid this error.`);
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue