Issues with git clone + ssh in pipeline

Hi, I have an issue with ssh keys.

kind: pipeline
type: docker
name: default

- name: test
  image: python:3.9
      from_secret: ssh_key
  - mkdir $HOME/.ssh
  - echo "$SSH_KEY" > $HOME/.ssh/id_rsa
  - chmod 600 $HOME/.ssh/id_rsa
  - ssh-keyscan > $HOME/.ssh/known_hosts
  - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  - pip install pytest
  - pytest -v tests/* --junitxml=test-reports/report.xml



Output is:

Collecting git+ssh://**** (from -r requirements.txt (line 1))
  Cloning ssh://**** to /tmp/pip-req-build-2aedxflp
  Running command git clone -q 'ssh://****' /tmp/pip-req-build-2aedxflp
  Warning: Permanently added the ECDSA host key for IP address '' to the list of known hosts.
  Permission denied, please try again.
  Permission denied, please try again. Permission denied (publickey,password).
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.

It’s a gitea repository and my public ssh key exists in it.
What am I doing wrong here?

Thanks in advance