Configure serverless framework to connect to github with SSH

I have a lambda running on AWS that is built with Serverless Framework. My front and back share some code factorised in a private library I created and host on a github private repo.

I managed to install this common library locally in both projects as a dependency like this in package.jsons:

  ...
  "lib-common": "https://<token_xxx>:x-oauth-basic@github.com:<my_account>/lib-common.git#abcdef12",
  ...

But when building with Serverless Framework, the pipeline fails with error

    npm ERR! /usr/bin/git ls-remote -h -t 
    ssh://git@github.com/<my_account>/lib-common.git
    npm ERR!
 
    npm ERR! Host key verification failed.
    npm ERR! fatal: Could not read from remote repository.

How to configure Serverless Framework pipelines to connect to github using SSH?

For a quick test, I tried with no luck to change the lines in package-lock.jsons to:

  ...
  "lib-common": {
    "version": "https://<token_xxx>:x-oauth-basic@github.com:<my_account>/lib-common.git#abcdef12abcdef12abcdef12abcdef12",
    "from": "https://<token_xxx>:x-oauth-basic@github.com:<my_account>/lib-common.git#abcdef12",
    "requires": {
      "lodash": "^4.17.15"
    }
  },
  ...

from

  ...
  "lib-common": {
    "version": "git+ssh://git@github.com/<my_account>/lib-common.git#abcdef12abcdef12abcdef12abcdef12",
    "from": "git+ssh://git@github.com/<my_account>/lib-common.git#abcdef12",
    "requires": {
      "lodash": "^4.17.15"
    }
  },
  ...

Thanks

were you able to find a solution to this ?

Not yet unfortunately. What I am doing today is deploying from my computer with the CLI.
It works but it’s far from ideal.