payload: {"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform-github-actions/issues/39","repository_url":"https://api.github.com/repos/hashicorp/terraform-github-actions","labels_url":"https://api.github.com/repos/hashicorp/terraform-github-actions/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform-github-actions/issues/39/comments","events_url":"https://api.github.com/repos/hashicorp/terraform-github-actions/issues/39/events","html_url":"https://github.com/hashicorp/terraform-github-actions/issues/39","id":480105279,"node_id":"MDU6SXNzdWU0ODAxMDUyNzk=","number":39,"title":"Git SSH cloning fails","user":{"login":"Vlaaaaaaad","id":5440007,"node_id":"MDQ6VXNlcjU0NDAwMDc=","avatar_url":"https://avatars3.githubusercontent.com/u/5440007?v=4","gravatar_id":"","url":"https://api.github.com/users/Vlaaaaaaad","html_url":"https://github.com/Vlaaaaaaad","followers_url":"https://api.github.com/users/Vlaaaaaaad/followers","following_url":"https://api.github.com/users/Vlaaaaaaad/following{/other_user}","gists_url":"https://api.github.com/users/Vlaaaaaaad/gists{/gist_id}","starred_url":"https://api.github.com/users/Vlaaaaaaad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vlaaaaaaad/subscriptions","organizations_url":"https://api.github.com/users/Vlaaaaaaad/orgs","repos_url":"https://api.github.com/users/Vlaaaaaaad/repos","events_url":"https://api.github.com/users/Vlaaaaaaad/events{/privacy}","received_events_url":"https://api.github.com/users/Vlaaaaaaad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2019-08-13T11:30:31Z","updated_at":"2019-09-27T12:23:21Z","closed_at":null,"author_association":"NONE","body":"When using the `init` action as defined below:\r\n```\r\nname: Terraform\r\n\r\non: [push]\r\n\r\njobs:\r\n\r\n  Formatting:\r\n    runs-on: ubuntu-latest\r\n    \r\n    steps:\r\n    - uses: actions/checkout@master\r\n    \r\n    - name: Formatting\r\n      uses: hashicorp/terraform-github-actions/fmt@v0.3.5\r\n\r\n  Validation:\r\n    runs-on: ubuntu-latest\r\n    \r\n    steps:\r\n    - uses: actions/checkout@master\r\n\r\n    - name: Init\r\n      uses: hashicorp/terraform-github-actions/init@v0.3.5\r\n    \r\n    - name: Validation\r\n      uses: hashicorp/terraform-github-actions/validate@v0.3.5\r\n      env:\r\n        AWS_DEFAULT_REGION: us-east-1\r\n```\r\nthe `init` step fails due to not being able to clone the repo:\r\n```\r\n[DEBUG] Using modified User-Agent: Terraform/0.12.6 terraform-github-actions/1.0\r\nInitializing modules...\r\nDownloading git@github.com:terraform-aws-modules/terraform-aws-eks.git?ref=v5.0.0 for eks...\r\n\r\nError: Failed to download module\r\n\r\nCould not download module \"eks\" (eks.tf:1) source code from\r\n\"git@github.com:terraform-aws-modules/terraform-aws-eks.git?ref=v5.0.0\": error\r\ndownloading\r\n'ssh://git@github.com/terraform-aws-modules/terraform-aws-eks.git?ref=v5.0.0':\r\n/usr/bin/git exited with 128: Cloning into '.terraform/modules/eks'...\r\nHost key verification failed.\r\nfatal: Could not read from remote repository.\r\n\r\nPlease make sure you have the correct access rights\r\nand the repository exists.\r\n```\r\n\r\n\r\nAny ideas about how this could be fixed? \r\n\r\nThe npm action has [a comment suggesting some bash magic to insert SSH keys](https://github.com/actions/npm/issues/25#issuecomment-486818213). Maybe something along these lines?\r\n\r\nI am new to GitHub actions so I may be totally missing something."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform-github-actions/issues/comments/535916626","html_url":"https://github.com/hashicorp/terraform-github-actions/issues/39#issuecomment-535916626","issue_url":"https://api.github.com/repos/hashicorp/terraform-github-actions/issues/39","id":535916626,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNTkxNjYyNg==","user":{"login":"abatilo","id":1634746,"node_id":"MDQ6VXNlcjE2MzQ3NDY=","avatar_url":"https://avatars3.githubusercontent.com/u/1634746?v=4","gravatar_id":"","url":"https://api.github.com/users/abatilo","html_url":"https://github.com/abatilo","followers_url":"https://api.github.com/users/abatilo/followers","following_url":"https://api.github.com/users/abatilo/following{/other_user}","gists_url":"https://api.github.com/users/abatilo/gists{/gist_id}","starred_url":"https://api.github.com/users/abatilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abatilo/subscriptions","organizations_url":"https://api.github.com/users/abatilo/orgs","repos_url":"https://api.github.com/users/abatilo/repos","events_url":"https://api.github.com/users/abatilo/events{/privacy}","received_events_url":"https://api.github.com/users/abatilo/received_events","type":"User","site_admin":false},"created_at":"2019-09-27T12:23:21Z","updated_at":"2019-09-27T12:23:21Z","author_association":"NONE","body":"This is what I ended up doing to clone a private module, and it definitely worked even if a bit wonky.\r\n```\r\n    - name: Create .ssh directory\r\n      uses: actions/bin/sh@master\r\n      with:\r\n        args: '\"mkdir -p $HOME/.ssh\"'\r\n    - name: Write SSH key to disk\r\n      uses: actions/bin/sh@master\r\n      env:\r\n        SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}\r\n      with:\r\n        args: '\"echo \\\"$SSH_PRIVATE_KEY\\\" > $HOME/.ssh/id_rsa\"'\r\n    - name: Set SSH key permissions\r\n      uses: actions/bin/sh@master\r\n      with:\r\n        args: '\"chmod 400 $HOME/.ssh/id_rsa\"'\r\n    - name: Terraform Init\r\n      uses: hashicorp/terraform-github-actions/init@v0.4.0\r\n      env:\r\n        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\r\n        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\r\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\r\n        GIT_SSH_COMMAND: \"ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa\"\r\n        TF_ACTION_WORKING_DIR: ${{ matrix.folders }}\r\n```"}}
other: {"actor":{"display_login":"abatilo"}}