Q:

Gitlab pipeline fails pushing to Heroku

I created my .gitlab-ci.yml:
heroku:
stage: deploy
only:
- master
script:
- git remote add heroku https://heroku:$HEROKU_API_KEY@git.heroku.com/my-prohject-09034.git
- git push -f heroku master

I also created my variable $HEROKU_API_KEY In gitlab and set it to protected.
When I push my code to Gitlab it starts the pipleline but it keeps failing, I get this error:
**error: src refspec master does not match any.**

Not sure what the issue is.

A:

It turns out I had to change the last line of my .gitlab-ci.yml file to:
 git push -f heroku HEAD:master

