title: Github actions permission denied (publickey)
body: <p>I'm stucked trying to launch a Github actions workflow.
  The Flutter project has a dependency of a custom package. I have this custom package in a Github repository. This is the way I set up this dependency in the pubspec.yaml:</p>
  <pre><code>xxxx_package:
  git:
    url: git@github.com:USER_NAME/xxxx_package.git
    ref: develop
  </code></pre>
  <p>If I launch <em>flutter pub get</em> command, it ends successful and I can build and execute the app without problems.</p>
  <p>But when I send a push to Github and it launches the workflow, the process finish with this error:</p>
  <pre><code>Running &quot;flutter pub get&quot; in Project-Flutter...            
  Git error. Command: `git clone --mirror git@github.com:xxx/xxxx_package.git /home/runner/.pub-cache/git/cache/xxxx_package-123456789`
  stdout: 
  stderr: Cloning into bare repository '/home/runner/.pub-cache/git/cache/xxxx_package-123456789'...
  git@github.com: Permission denied (publickey).
  fatal: Could not read from remote repository.
  </code></pre>
  <p>This is my actions workflow file:</p>
  <pre><code>name: Check merge
  
  on:
    push:
      branches: [ main, develop ]
  
    pull_request:
      branches: [main, develop]
      
  
    workflow_dispatch:
  
  jobs:
    build:
      name: flutter environment
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v2
        - uses: actions/setup-java@v2
          with:
            distribution: 'zulu'
            java-version: '11'
        - uses: subosito/flutter-action@v2
          with:
            flutter-version: '2.8.1'
        - name: Install dependencies
          run: flutter pub get
        - run: flutter format --set-exit-if-changed .
        - run: flutter analyze .
        - run: flutter test
  </code></pre>
  <p>I have configured the custom package repository to work with shh.</p>
  <p><strong>UPDATE 02/17/2022</strong></p>
  <p>I tried the @GuiFalourd suggestion but not working.</p>
  <p>I've added to both repos (main project and private repo) two secrets (same for both).</p>
  <ul>
  <li>KNOWN_HOSTS</li>
  <li>SSH_PRIVATE_KEY -&gt; This is the content
  -----BEGIN RSA PRIVATE KEY-----
  ssh-ed25519 &quot;<em>SSH_KEY</em>&quot;
  -----END RSA PRIVATE KEY-----</li>
  </ul>
  <p>But this is the output:</p>
  <pre><code>IO  : Finished git. Exit code 128.
  | Nothing output on stdout.
  | stderr:
  | | Cloning into bare repository '/home/runner/.pub-cache/git/cache/xxxx_package-363daa26604baf2e3bfeae08af7d9c7050760631'...
  | | Warning: Permanently added the ECDSA host key for IP address 'x.x.x.x' to the list of known hosts.
  | | Load key &quot;/home/runner/.ssh/id_rsa&quot;: invalid format
  | | git@github.com: Permission denied (publickey).
  | | fatal: Could not read from remote repository.
  | | 
  | | Please make sure you have the correct access rights
  | | and the repository exists.
  </code></pre>