diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 465dbfe2..e6e227e2 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -84,6 +84,9 @@ on: VAULT_TOKEN: required: false description: A Vault token in case vault is required + KNOWN_HOSTS: + required: false + description: SSH known hosts jobs: terragrunt: @@ -105,28 +108,28 @@ jobs: ref: main path: actions - - uses: javbit/ssh-agent@jav/home - with: - ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_TFMODULES }} + # - uses: javbit/ssh-agent@jav/home + # with: + # ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_TFMODULES }} + # - name: Set up SSH + # run: | + # mkdir -p /home/runner/.ssh + # ssh-keyscan -H github.com >> $HOME/.ssh/known_hosts + # echo "${{ secrets.PRIVATE_SSH_KEY_TFMODULES }}" > $HOME/.ssh/github_actions + # chmod 600 /home/runner/.ssh/github_actions + # ssh-agent -a $SSH_AUTH_SOCK > /dev/null + # ssh-add /home/runner/.ssh/github_actions + # git config --global core.sshCommand "ssh -F $HOME/.ssh/github_actions" + # env: + # PRIVATE_SSH_KEY_TFMODULES: ${{ secrets.PRIVATE_SSH_KEY_TFMODULES }} + # SSH_AUTH_SOCK: /tmp/ssh_agent.sock + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.PRIVATE_SSH_KEY_TFMODULES }} + known_hosts: ${{ secrets.KNOWN_HOSTS }} - run: git clone git@github.com:signalwire/terraform-modules.git - # - name: Set up SSH - # run: | - # mkdir -p /home/runner/.ssh - # ssh-keyscan -H github.com >> $HOME/.ssh/known_hosts - # echo "${{ secrets.PRIVATE_SSH_KEY_TFMODULES }}" > $HOME/.ssh/github_actions - # chmod 600 /home/runner/.ssh/github_actions - # ssh-agent -a $SSH_AUTH_SOCK > /dev/null - # ssh-add /home/runner/.ssh/github_actions - # git config --global core.sshCommand "ssh -F $HOME/.ssh/github_actions" - # env: - # PRIVATE_SSH_KEY_TFMODULES: ${{ secrets.PRIVATE_SSH_KEY_TFMODULES }} - # SSH_AUTH_SOCK: /tmp/ssh_agent.sock - # - name: Install SSH key - # uses: shimataro/ssh-key-action@v2 - # with: - # key: ${{ secrets.PRIVATE_SSH_KEY_TFMODULES }} - # known_hosts: github.com - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4.0.1