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

add test for if_key_exists=ignore

This commit is contained in:
shimataro 2021-03-07 19:59:48 +09:00
parent 0fdb885c6e
commit 0814a68adb
No known key found for this signature in database
GPG key ID: BE92C05736911A9D

View file

@ -72,8 +72,9 @@ jobs:
run: ls -l ~/.ssh run: ls -l ~/.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
replace_key_if_exists:
name: Replace key if exists key_if_exists_replace-key_exists:
name: if_key_exists=replace / key exists
runs-on: ubuntu-16.04 runs-on: ubuntu-16.04
steps: steps:
- name: Checkout source codes - name: Checkout source codes
@ -81,7 +82,7 @@ jobs:
- name: Install SSH key (dummy) - name: Install SSH key (dummy)
uses: ./. uses: ./.
with: with:
key: "dummy" key: "dummy" # replaced
known_hosts: ${{ secrets.KNOWN_HOSTS }} known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Install SSH key (replace) - name: Install SSH key (replace)
uses: ./. uses: ./.
@ -93,8 +94,8 @@ jobs:
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
replace_key_if_exists_created: key_if_exists_replace-key_doesnt_exist:
name: Create key if not exist (if_key_exists=replace) name: if_key_exists=replace / key doesn't exist
runs-on: ubuntu-16.04 runs-on: ubuntu-16.04
steps: steps:
- name: Checkout source codes - name: Checkout source codes
@ -109,3 +110,41 @@ jobs:
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
key_if_exists_ignore-key_exists:
name: if_key_exists=ignore / key exists
runs-on: ubuntu-16.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key (dummy)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Install SSH key (replace)
uses: ./.
with:
key: "dummy" # ignored
known_hosts: ${{ secrets.KNOWN_HOSTS }}
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
key_if_exists_ignore-key_doesnt_exist:
name: if_key_exists=ignore / key doesn't exist
runs-on: ubuntu-16.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key (replace)
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
if_key_exists: ignore
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp