mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
Feature/GitHub key (#122)
* always prepend key of github.com * update README and CHANGELOG * update tests * test to connect bitbucket.org * update test * update rest tests
This commit is contained in:
parent
bcb314ec07
commit
1512adeca4
11 changed files with 644 additions and 255 deletions
|
@ -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
|
||||||
|
@ -311,4 +313,8 @@ rules: # https://eslint.org/docs/rules/
|
||||||
- error
|
- error
|
||||||
- functions: false
|
- functions: false
|
||||||
"@typescript-eslint/semi": error
|
"@typescript-eslint/semi": error
|
||||||
"@typescript-eslint/strict-boolean-expressions": error
|
"@typescript-eslint/strict-boolean-expressions":
|
||||||
|
- error
|
||||||
|
- allowString: false
|
||||||
|
allowNumber: false
|
||||||
|
allowNullableObject: false
|
||||||
|
|
146
.github/workflows/verify-on-container-alpine.yml
vendored
146
.github/workflows/verify-on-container-alpine.yml
vendored
|
@ -31,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 }}
|
||||||
|
@ -61,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 }}
|
||||||
|
@ -91,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
|
||||||
|
@ -122,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
|
||||||
|
@ -158,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
|
||||||
|
@ -190,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
|
||||||
|
@ -226,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
|
||||||
|
@ -258,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
|
||||||
|
@ -295,38 +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
|
|
||||||
- ubuntu-22.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
|
|
||||||
|
|
142
.github/workflows/verify-on-container-centos.yml
vendored
142
.github/workflows/verify-on-container-centos.yml
vendored
|
@ -30,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 }}
|
||||||
|
@ -59,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 }}
|
||||||
|
@ -88,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
|
||||||
|
@ -118,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
|
||||||
|
@ -153,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
|
||||||
|
@ -184,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
|
||||||
|
@ -219,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
|
||||||
|
@ -250,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
|
||||||
|
@ -286,37 +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
|
|
||||||
- ubuntu-22.04
|
|
||||||
container:
|
|
||||||
- quay.io/centos/centos:centos7
|
|
||||||
- quay.io/centos/centos:stream8
|
|
||||||
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
|
|
||||||
|
|
154
.github/workflows/verify-on-container-ubuntu.yml
vendored
154
.github/workflows/verify-on-container-ubuntu.yml
vendored
|
@ -33,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 }}
|
||||||
|
@ -65,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 }}
|
||||||
|
@ -97,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
|
||||||
|
@ -130,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
|
||||||
|
@ -168,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
|
||||||
|
@ -202,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
|
||||||
|
@ -240,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
|
||||||
|
@ -274,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
|
||||||
|
@ -313,40 +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
|
|
||||||
- ubuntu-22.04
|
|
||||||
container:
|
|
||||||
- ubuntu:16.04
|
|
||||||
- ubuntu:18.04
|
|
||||||
- ubuntu:20.04
|
|
||||||
- ubuntu:22.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
|
|
||||||
|
|
117
.github/workflows/verify-on-macos.yml
vendored
117
.github/workflows/verify-on-macos.yml
vendored
|
@ -23,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 }}
|
||||||
|
@ -45,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 }}
|
||||||
|
@ -67,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 }}
|
||||||
|
@ -89,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
|
||||||
|
@ -118,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
|
||||||
|
@ -146,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
|
||||||
|
@ -170,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
|
||||||
|
@ -198,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
|
||||||
|
@ -222,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
|
||||||
|
@ -251,30 +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
|
|
||||||
- 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: unnecessary
|
|
||||||
- name: print created files
|
|
||||||
run: ls -l ~/.ssh
|
|
||||||
|
|
125
.github/workflows/verify-on-ubuntu.yml
vendored
125
.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 }}
|
||||||
|
@ -44,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 }}
|
||||||
|
@ -58,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
|
||||||
|
@ -65,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 }}
|
||||||
|
@ -79,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
|
||||||
|
@ -86,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
|
||||||
|
@ -107,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
|
||||||
|
@ -114,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
|
||||||
|
@ -134,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
|
||||||
|
@ -141,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
|
||||||
|
@ -157,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
|
||||||
|
@ -164,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
|
||||||
|
@ -184,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
|
||||||
|
@ -191,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
|
||||||
|
@ -207,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
|
||||||
|
@ -214,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
|
||||||
|
@ -235,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
|
||||||
|
@ -242,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
|
|
||||||
|
|
127
.github/workflows/verify-on-windows.yml
vendored
127
.github/workflows/verify-on-windows.yml
vendored
|
@ -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 }}
|
||||||
|
@ -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 }}
|
||||||
|
@ -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 }}
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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-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: unnecessary
|
|
||||||
- name: print created files
|
|
||||||
run: ls -l ~/.ssh
|
|
||||||
|
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* always set server key of `github.com` to `known_hosts`
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* usage of `rsync` in README
|
* usage of `rsync` in README
|
||||||
|
|
|
@ -45,6 +45,8 @@ steps:
|
||||||
|
|
||||||
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.
|
||||||
|
|
35
lib/index.js
35
lib/index.js
|
@ -2723,6 +2723,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(147));
|
const fs_1 = __importDefault(__nccwpck_require__(147));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(17));
|
const path_1 = __importDefault(__nccwpck_require__(17));
|
||||||
const core = __importStar(__nccwpck_require__(186));
|
const core = __importStar(__nccwpck_require__(186));
|
||||||
|
const KNOWN_HOSTS = [
|
||||||
|
"github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==",
|
||||||
|
];
|
||||||
try {
|
try {
|
||||||
main();
|
main();
|
||||||
}
|
}
|
||||||
|
@ -2748,7 +2751,16 @@ function main() {
|
||||||
// create ".ssh" directory
|
// create ".ssh" directory
|
||||||
const sshDirName = createSshDirectory();
|
const sshDirName = createSshDirectory();
|
||||||
// files to be created
|
// files to be created
|
||||||
const files = [];
|
const files = [
|
||||||
|
{
|
||||||
|
name: "known_hosts",
|
||||||
|
contents: insertLf(buildKnownHostsArray(knownHosts).join("\n"), true, true),
|
||||||
|
options: {
|
||||||
|
mode: 0o644,
|
||||||
|
flag: "a",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
if (shouldCreateKeyFile(path_1.default.join(sshDirName, name), ifKeyExists)) {
|
if (shouldCreateKeyFile(path_1.default.join(sshDirName, name), ifKeyExists)) {
|
||||||
files.push({
|
files.push({
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -2759,16 +2771,6 @@ function main() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (knownHosts !== "unnecessary") {
|
|
||||||
files.push({
|
|
||||||
name: "known_hosts",
|
|
||||||
contents: insertLf(knownHosts, true, true),
|
|
||||||
options: {
|
|
||||||
mode: 0o644,
|
|
||||||
flag: "a",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (config !== "") {
|
if (config !== "") {
|
||||||
files.push({
|
files.push({
|
||||||
name: "config",
|
name: "config",
|
||||||
|
@ -2872,6 +2874,17 @@ function shouldCreateKeyFile(keyFilePath, ifKeyExists) {
|
||||||
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.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* build array of known_hosts
|
||||||
|
* @param knownHosts known_hosts
|
||||||
|
* @returns array of known_hosts
|
||||||
|
*/
|
||||||
|
function buildKnownHostsArray(knownHosts) {
|
||||||
|
if (knownHosts === "unnecessary") {
|
||||||
|
return KNOWN_HOSTS;
|
||||||
|
}
|
||||||
|
return KNOWN_HOSTS.concat(knownHosts);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
37
src/main.ts
37
src/main.ts
|
@ -9,6 +9,10 @@ interface FileInfo {
|
||||||
options: fs.WriteFileOptions;
|
options: fs.WriteFileOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const KNOWN_HOSTS = [
|
||||||
|
"github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==",
|
||||||
|
];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
main();
|
main();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -36,7 +40,16 @@ function main(): void {
|
||||||
const sshDirName = createSshDirectory();
|
const sshDirName = createSshDirectory();
|
||||||
|
|
||||||
// files to be created
|
// files to be created
|
||||||
const files: FileInfo[] = [];
|
const files: FileInfo[] = [
|
||||||
|
{
|
||||||
|
name: "known_hosts",
|
||||||
|
contents: insertLf(buildKnownHostsArray(knownHosts).join("\n"), true, true),
|
||||||
|
options: {
|
||||||
|
mode: 0o644,
|
||||||
|
flag: "a",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
if (shouldCreateKeyFile(path.join(sshDirName, name), ifKeyExists)) {
|
if (shouldCreateKeyFile(path.join(sshDirName, name), ifKeyExists)) {
|
||||||
files.push({
|
files.push({
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -47,16 +60,6 @@ function main(): void {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (knownHosts !== "unnecessary") {
|
|
||||||
files.push({
|
|
||||||
name: "known_hosts",
|
|
||||||
contents: insertLf(knownHosts, true, true),
|
|
||||||
options: {
|
|
||||||
mode: 0o644,
|
|
||||||
flag: "a",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (config !== "") {
|
if (config !== "") {
|
||||||
files.push({
|
files.push({
|
||||||
name: "config",
|
name: "config",
|
||||||
|
@ -175,3 +178,15 @@ function shouldCreateKeyFile(keyFilePath: string, ifKeyExists: string): boolean
|
||||||
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.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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