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
146
.github/workflows/verify-on-container-alpine.yml
vendored
146
.github/workflows/verify-on-container-alpine.yml
vendored
|
@ -31,11 +31,42 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
ssh-pem-bitbucket:
|
||||
name: Connect to bitbucket.org (PEM format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-22.04
|
||||
container:
|
||||
- alpine:3.10
|
||||
- alpine:3.11
|
||||
- alpine:3.12
|
||||
- alpine:3.13
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: apk add openssh-client git
|
||||
- name: Checkout source codes
|
||||
uses: actions/checkout@v2
|
||||
- name: Install SSH key
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: |
|
||||
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
|
||||
ssh-pkcs8:
|
||||
name: Connect to github.com (PKCS8 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
@ -61,11 +92,42 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
ssh-pkcs8-bitbucket:
|
||||
name: Connect to bitbucket.org (PKCS8 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-22.04
|
||||
container:
|
||||
- alpine:3.10
|
||||
- alpine:3.11
|
||||
- alpine:3.12
|
||||
- alpine:3.13
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: apk add openssh-client git
|
||||
- name: Checkout source codes
|
||||
uses: actions/checkout@v2
|
||||
- name: Install SSH key
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PKCS8 }}
|
||||
known_hosts: |
|
||||
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
|
||||
ssh-rfc4716:
|
||||
name: Connect to github.com (RFC4716 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
@ -91,11 +153,42 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
ssh-rfc4716-bitbucket:
|
||||
name: Connect to bitbucket.org (RFC4716 format)
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-22.04
|
||||
container:
|
||||
- alpine:3.10
|
||||
- alpine:3.11
|
||||
- alpine:3.12
|
||||
- alpine:3.13
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: apk add openssh-client git
|
||||
- name: Checkout source codes
|
||||
uses: actions/checkout@v2
|
||||
- name: Install SSH key
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_RFC4716 }}
|
||||
known_hosts: |
|
||||
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@bitbucket.org:shimataro999/ssh-test.git tmp
|
||||
|
||||
key_if_exists_replace-key_exists:
|
||||
name: if_key_exists=replace / key exists
|
||||
|
@ -122,12 +215,12 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: "dummy" # replaced
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: Install SSH key (replace)
|
||||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: replace
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
|
@ -158,7 +251,7 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: replace
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
|
@ -190,12 +283,12 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: Install SSH key (replace)
|
||||
uses: ./.
|
||||
with:
|
||||
key: "dummy" # ignored
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: ignore
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
|
@ -226,7 +319,7 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: ignore
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
|
@ -258,12 +351,12 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
- name: Install SSH key (replace)
|
||||
uses: ./.
|
||||
with:
|
||||
key: "dummy" # ignored
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: fail
|
||||
continue-on-error: true
|
||||
- name: print created files
|
||||
|
@ -295,38 +388,9 @@ jobs:
|
|||
uses: ./.
|
||||
with:
|
||||
key: ${{ secrets.SSH_KEY_PEM }}
|
||||
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||
known_hosts: unnecessary
|
||||
if_key_exists: fail
|
||||
- name: print created files
|
||||
run: ls -l /root/.ssh
|
||||
- name: git clone through SSH
|
||||
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
||||
|
||||
known_hosts-unnecessary:
|
||||
name: without known_hosts file
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
- 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue