From 08d9101dc80d01451a71739d9a47111707367339 Mon Sep 17 00:00:00 2001 From: shimataro Date: Tue, 20 Dec 2022 18:39:55 +0900 Subject: [PATCH] reuse container workflows --- .../workflows/reusable-verify-container.yml | 294 +++++++++++++ .../workflows/verify-on-container-alpine.yml | 384 +---------------- .../workflows/verify-on-container-centos.yml | 374 +--------------- .../workflows/verify-on-container-ubuntu.yml | 406 +----------------- 4 files changed, 318 insertions(+), 1140 deletions(-) create mode 100644 .github/workflows/reusable-verify-container.yml diff --git a/.github/workflows/reusable-verify-container.yml b/.github/workflows/reusable-verify-container.yml new file mode 100644 index 0000000..9fb24ba --- /dev/null +++ b/.github/workflows/reusable-verify-container.yml @@ -0,0 +1,294 @@ +# reusable workflow: Verify container +# https://docs.github.com/en/actions/using-workflows/reusing-workflows +on: + workflow_call: + inputs: + os: + required: true + type: string + description: "'runs-on'" + container: + required: true + type: string + description: container name + package_installation_command: + required: false + type: string + default: "" + description: package installation command + secrets: + SSH_KEY_PEM: + required: true + description: SSH private key (PEM format) + SSH_KEY_PKCS8: + required: true + description: SSH private key (PKCS8 format) + SSH_KEY_RFC4716: + required: true + description: SSH private key (RFC4716 format) + +jobs: + ssh-pem: + name: Connect to github.com (PEM format) + runs-on: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - 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 /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: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - 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 /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: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key + uses: ./. + with: + key: ${{ secrets.SSH_KEY_PKCS8 }} + known_hosts: unnecessary + - name: print created files + run: ls /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: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - 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 /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: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key + uses: ./. + with: + key: ${{ secrets.SSH_KEY_RFC4716 }} + known_hosts: unnecessary + - name: print created files + run: ls /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: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - 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 /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 + runs-on: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key (dummy) + uses: ./. + with: + key: "dummy" # replaced + known_hosts: unnecessary + - name: Install SSH key (replace) + uses: ./. + with: + key: ${{ secrets.SSH_KEY_PEM }} + known_hosts: unnecessary + if_key_exists: replace + - name: print created files + run: ls /root/.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: + name: if_key_exists=replace / key doesn't exist + runs-on: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key (replace) + uses: ./. + with: + key: ${{ secrets.SSH_KEY_PEM }} + known_hosts: unnecessary + if_key_exists: replace + - name: print created files + run: ls /root/.ssh + - name: git clone through SSH + 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: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key (dummy) + uses: ./. + with: + key: ${{ secrets.SSH_KEY_PEM }} + known_hosts: unnecessary + - name: Install SSH key (replace) + uses: ./. + with: + key: "dummy" # ignored + known_hosts: unnecessary + if_key_exists: ignore + - name: print created files + run: ls /root/.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: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key (replace) + uses: ./. + with: + key: ${{ secrets.SSH_KEY_PEM }} + known_hosts: unnecessary + if_key_exists: ignore + - name: print created files + run: ls /root/.ssh + - name: git clone through SSH + run: git clone git@github.com:shimataro/ssh-key-action.git tmp + + key_if_exists_fail-key_exists: + name: if_key_exists=fail / key exists + runs-on: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key (dummy) + uses: ./. + with: + key: ${{ secrets.SSH_KEY_PEM }} + known_hosts: unnecessary + - name: Install SSH key (replace) + uses: ./. + with: + key: "dummy" # ignored + known_hosts: unnecessary + if_key_exists: fail + continue-on-error: true + - name: print created files + run: ls /root/.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: + name: if_key_exists=fail / key doesn't exist + runs-on: ${{ inputs.os }} + container: ${{ inputs.container }} + steps: + - name: Install packages + run: ${{ inputs.package_installation_command }} + if: ${{ inputs.package_installation_command != '' }} + - name: Checkout source codes + uses: actions/checkout@v2 + - name: Install SSH key (replace) + uses: ./. + with: + key: ${{ secrets.SSH_KEY_PEM }} + known_hosts: unnecessary + if_key_exists: fail + - name: print created files + run: ls /root/.ssh + - name: git clone through SSH + run: git clone git@github.com:shimataro/ssh-key-action.git tmp diff --git a/.github/workflows/verify-on-container-alpine.yml b/.github/workflows/verify-on-container-alpine.yml index 5cecef5..bec63f5 100644 --- a/.github/workflows/verify-on-container-alpine.yml +++ b/.github/workflows/verify-on-container-alpine.yml @@ -6,194 +6,8 @@ on: - push jobs: - ssh-pem: - name: Connect to github.com (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: 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 }} - 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: 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 }} - 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: 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 - runs-on: ${{ matrix.os }} - container: ${{ matrix.container }} + verify: + name: Verify strategy: fail-fast: false matrix: @@ -206,191 +20,9 @@ jobs: - 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 (dummy) - uses: ./. - with: - key: "dummy" # replaced - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: replace - - 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 - key_if_exists_replace-key_doesnt_exist: - name: if_key_exists=replace / key doesn't exist - 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 (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: replace - - 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 - - key_if_exists_ignore-key_exists: - name: if_key_exists=ignore / key exists - 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 (dummy) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: "dummy" # ignored - known_hosts: unnecessary - if_key_exists: ignore - - 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 - key_if_exists_ignore-key_doesnt_exist: - name: if_key_exists=ignore / key doesn't exist - 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 (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: ignore - - 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 - - key_if_exists_fail-key_exists: - name: if_key_exists=fail / key exists - 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 (dummy) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: "dummy" # ignored - known_hosts: unnecessary - if_key_exists: fail - continue-on-error: true - - 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 - key_if_exists_fail-key_doesnt_exist: - name: if_key_exists=fail / key doesn't exist - 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 (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - 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 + uses: "./.github/workflows/reusable-verify-container.yml" + with: + os: ${{ matrix.os }} + container: ${{ matrix.container }} + package_installation_command: apk add openssh-client git + secrets: inherit diff --git a/.github/workflows/verify-on-container-centos.yml b/.github/workflows/verify-on-container-centos.yml index 6390499..3a6c461 100644 --- a/.github/workflows/verify-on-container-centos.yml +++ b/.github/workflows/verify-on-container-centos.yml @@ -6,188 +6,8 @@ on: - push jobs: - ssh-pem: - name: Connect to github.com (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: 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: - - 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: - name: Connect to github.com (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: 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: - - 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: - name: Connect to github.com (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: 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: - - 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: - name: if_key_exists=replace / key exists - runs-on: ${{ matrix.os }} - container: ${{ matrix.container }} + verify: + name: Verify strategy: fail-fast: false matrix: @@ -198,187 +18,9 @@ jobs: 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 (dummy) - uses: ./. - with: - key: "dummy" # replaced - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: replace - - 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 - key_if_exists_replace-key_doesnt_exist: - name: if_key_exists=replace / key doesn't exist - 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 (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: replace - - 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 - - key_if_exists_ignore-key_exists: - name: if_key_exists=ignore / key exists - 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 (dummy) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: "dummy" # ignored - known_hosts: unnecessary - if_key_exists: ignore - - 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 - key_if_exists_ignore-key_doesnt_exist: - name: if_key_exists=ignore / key doesn't exist - 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 (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: ignore - - 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 - - key_if_exists_fail-key_exists: - name: if_key_exists=fail / key exists - 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 (dummy) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: "dummy" # ignored - known_hosts: unnecessary - if_key_exists: fail - continue-on-error: true - - 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 - key_if_exists_fail-key_doesnt_exist: - name: if_key_exists=fail / key doesn't exist - 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 (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - 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 + uses: "./.github/workflows/reusable-verify-container.yml" + with: + os: ${{ matrix.os }} + container: ${{ matrix.container }} + package_installation_command: yum install -y git openssh-clients + secrets: inherit diff --git a/.github/workflows/verify-on-container-ubuntu.yml b/.github/workflows/verify-on-container-ubuntu.yml index acdb4cf..c5c977a 100644 --- a/.github/workflows/verify-on-container-ubuntu.yml +++ b/.github/workflows/verify-on-container-ubuntu.yml @@ -6,206 +6,8 @@ on: - push jobs: - ssh-pem: - name: Connect to github.com (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: 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: - - 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: - name: Connect to github.com (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: 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: - - 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: - name: Connect to github.com (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: 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: - - 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: - name: if_key_exists=replace / key exists - runs-on: ${{ matrix.os }} - container: ${{ matrix.container }} + verify: + name: Verify strategy: fail-fast: false matrix: @@ -218,203 +20,11 @@ jobs: - ubuntu:18.04 - ubuntu:20.04 - ubuntu:22.04 - steps: - - name: Install packages - run: | + uses: "./.github/workflows/reusable-verify-container.yml" + with: + os: ${{ matrix.os }} + container: ${{ matrix.container }} + package_installation_command: | apt update apt install -y openssh-client git - - name: Checkout source codes - uses: actions/checkout@v2 - - name: Install SSH key (dummy) - uses: ./. - with: - key: "dummy" # replaced - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: replace - - 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 - key_if_exists_replace-key_doesnt_exist: - name: if_key_exists=replace / key doesn't exist - 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 install -y openssh-client git - - name: Checkout source codes - uses: actions/checkout@v2 - - name: Install SSH key (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: replace - - 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 - - key_if_exists_ignore-key_exists: - name: if_key_exists=ignore / key exists - 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 install -y openssh-client git - - name: Checkout source codes - uses: actions/checkout@v2 - - name: Install SSH key (dummy) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: "dummy" # ignored - known_hosts: unnecessary - if_key_exists: ignore - - 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 - key_if_exists_ignore-key_doesnt_exist: - name: if_key_exists=ignore / key doesn't exist - 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 install -y openssh-client git - - name: Checkout source codes - uses: actions/checkout@v2 - - name: Install SSH key (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - if_key_exists: ignore - - 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 - - key_if_exists_fail-key_exists: - name: if_key_exists=fail / key exists - 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 install -y openssh-client git - - name: Checkout source codes - uses: actions/checkout@v2 - - name: Install SSH key (dummy) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - known_hosts: unnecessary - - name: Install SSH key (replace) - uses: ./. - with: - key: "dummy" # ignored - known_hosts: unnecessary - if_key_exists: fail - continue-on-error: true - - 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 - key_if_exists_fail-key_doesnt_exist: - name: if_key_exists=fail / key doesn't exist - 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 install -y openssh-client git - - name: Checkout source codes - uses: actions/checkout@v2 - - name: Install SSH key (replace) - uses: ./. - with: - key: ${{ secrets.SSH_KEY_PEM }} - 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 + secrets: inherit