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
127
.github/workflows/verify-on-windows.yml
vendored
127
.github/workflows/verify-on-windows.yml
vendored
|
@ -22,11 +22,33 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: print created files
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
ssh-pem-bitbucket:
|
||||
name: Connect to bitbucket.org (PEM format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- windows-2019
|
||||
- windows-2022
|
||||
steps:
|
||||
- name: Checkout source codes
|
||||
uses: actions/checkout@v2
|
||||
- name: Install SSH key
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: |
|
||||
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
|
||||
- name: print created files
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
|
||||
ssh-pkcs8:
|
||||
name: Connect to github.com (PKCS8 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
@ -43,11 +65,33 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: print created files
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
ssh-pkcs8-bitbucket:
|
||||
name: Connect to bitbucket.org (PKCS8 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- windows-2019
|
||||
- windows-2022
|
||||
steps:
|
||||
- name: Checkout source codes
|
||||
uses: actions/checkout@v2
|
||||
- name: Install SSH key
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||
known_hosts: |
|
||||
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
|
||||
- name: print created files
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
|
||||
ssh-rfc4716:
|
||||
name: Connect to github.com (RFC4716 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
@ -64,11 +108,34 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: print created files
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
ssh-rfc4716-bitbucket:
|
||||
name: Connect to bitbucket.org (RFC4716 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- windows-2019
|
||||
- windows-2022
|
||||
steps:
|
||||
- name: Checkout source codes
|
||||
uses: actions/checkout@v2
|
||||
- name: Install SSH key
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||
known_hosts: |
|
||||
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
|
||||
- name: print created files
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
|
||||
|
||||
ssh-with-name:
|
||||
name: Connect to github.com with name and config
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
@ -85,7 +152,7 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
name: ssh_key_name # optional
|
||||
config: | # optional
|
||||
Host github
|
||||
|
@ -93,7 +160,7 @@ jobs:
|
|||
User git
|
||||
IdentityFile ~/.ssh/ssh_key_name
|
||||
- name: print created files
|
||||
run: ls -l ~/.ssh
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone github:shimataro/ssh-key-action.git tmp
|
||||
|
||||
|
@ -113,15 +180,15 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: "dummy" # replaced
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: Install SSH key (replace)
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: replace
|
||||
- name: print created files
|
||||
run: ls -l ~/.ssh
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
key_if_exists_replace-key_doesnt_exist:
|
||||
|
@ -140,10 +207,10 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: replace
|
||||
- name: print created files
|
||||
run: ls -l ~/.ssh
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
|
||||
|
@ -163,15 +230,15 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: Install SSH key (replace)
|
||||
uses: ./.
|
||||
with:
|
||||
key: "dummy" # ignored
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: ignore
|
||||
- name: print created files
|
||||
run: ls -l ~/.ssh
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
key_if_exists_ignore-key_doesnt_exist:
|
||||
|
@ -190,10 +257,10 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: ignore
|
||||
- name: print created files
|
||||
run: ls -l ~/.ssh
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
|
||||
|
@ -213,16 +280,16 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: Install SSH key (replace)
|
||||
uses: ./.
|
||||
with:
|
||||
key: "dummy" # ignored
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: fail
|
||||
continue-on-error: true
|
||||
- name: print created files
|
||||
run: ls -l ~/.ssh
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
key_if_exists_fail-key_doesnt_exist:
|
||||
|
@ -241,29 +308,9 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: fail
|
||||
- name: print created files
|
||||
run: ls -l ~/.ssh
|
||||
run: ls ~/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
|
||||
known_hosts-unnecessary:
|
||||
name: without known_hosts file
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- windows-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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue