I did finally manage to get it working. I followed the instructions for generating a new ssh key in the link above. This didn't solve the problem (the instructions aren't that straight forward so I might have done something wrong).
So I entered
git push origin HEAD in the terminal because this is the step that skpm is getting stuck on.
It took me a while to work out that I had to enter an access token in place of my password (because 2-factor-authentication is enabled on my account https://help.github.com/articles/providing-your-2fa-authentication-code/#when-youll-be-asked-for-a-personal-access-token-as-a-password).
skpm publish doesn't require a password from now on.
I had further problems though. publishing failed because of git tags created with previous attempts to publish.
I used this command in the terminal to delete them all so i could start from scratch:
git tag | xargs git tag -d
The only issue I'm getting now is an error near the end of the publish process due to a pull request already existing for my plugin, and a change made by skpm to the plugin version number in the
manifest.json in the plugin package does not get committed. I'm not sure if the pull request error causes the process to halt resulting in the commit not happening. Of course it is easy to commitand sync the change manually, but this leaves the release 2 commits behind the master https://github.com/perrysmotors/sketch-unsplasher/releases/tag/v1.0.0
Will this cause a problem with people using my plugin not being notified about version updates in Sketch?