I have two repositories, REPO1 and REPO2, which are both owned by the same team. When running the pipeline of REPO1, I need to have write access to REPO1 and read access to REPO2.
I tried to enable this by generating an SSH key for the pipeline in REPO1, and adding the SSH key to the team account. This allows me to write to REPO1, but throws the following error when trying to clone REPO2:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Command "git clone -q ssh://bitbucket.org/team/REPO2.git /tmp/pip-req-build-49zb0fvl" failed with error code 128 in None
It seems to me that adding the SSH key to the team account should grant read/write access to all its repositories?
Git cloning REPO2 does work when I add the SSH key as an access key to REPO2. However I cannot add it to the team account and REPO2 at the same time, so I lose write access to REPO1.
I know I can solve this by adding multiple SSH keys to the pipeline, but I would not like to go there unless it is absolutely necessary.
Hi Robbe,
Can you provide a few more steps on how to reproduce your issue? I did the following and everything seemed to work fine.
image: atlassian/default-image:2
pipelines:
default:
- step:
script:
- echo "Everything is awesome!"
- git clone git@bitbucket.org:testsshphil/repo1.git
Can you retry the SSH key creation again, with the same procedure as I did above.
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.