heroku-deploy: Error: Command failed: heroku login

Hi, hope you’re having a good weekend!

I am currently getting this error:

Created and wrote to ~/.netrc
 ›   Warning: Our terms of service have changed: 
 ›   https://dashboard.heroku.com/terms-of-service
Error: Error: Command failed: heroku login
 ›   Warning: Our terms of service have changed: 
 ›   https://dashboard.heroku.com/terms-of-service
 ›   Error: Cannot log in with HEROKU_API_KEY set

 ›   Error: Cannot log in with HEROKU_API_KEY set

I have double and tripple checked my heroku_api_key , heroku_app_name and heroku_email and they are all correct. Was there a change to how the heroku api works recently?

Below is my config:

      - name: Deploy Production
        uses: akhileshns/heroku-deploy@v3.8.9 # This is the action
        if: contains(github.ref, 'main')
        with:
          heroku_api_key: ${{ env.HEROKU_API_KEY }}
          heroku_app_name: ${{ env.HEROKU_APP_NAME_PRODUCTION }}
          heroku_email: ${{ env.HEROKU_EMAIL }}
          healthcheck: ${{ env.HEROKU_HEALTH_CHECK_URL_PRODUCTION }}
          checkstring: 'ok'
          rollbackonhealthcheckfailed: true

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (6 by maintainers)

Most upvoted comments

hey @cj and @kylefritz, based on the conversation I had with @engeldevelopment. I’ve concluded the problem is likely due to Git now switching from “master” to “main”. I’ve updated the action to push to “main” by default (or you can push to master by just adding remote_branch: master). Have a look at the documentation for more info. Let me know if this solves your problem and if it does please close this issue

Based on the research I’ve done, this might have something to do with Git moving from the ‘master’ branch to ‘main’.

On that note, could you try adding the following property to your action implementation

remote_branch: main