Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Error: Command failed: git push heroku HEAD:refs/heads/main --force. 'heroku' does not appear to be a git repository #107

Closed
mattfranciswork0 opened this issue Nov 15, 2021 · 3 comments

Comments

@mattfranciswork0
Copy link

mattfranciswork0 commented Nov 15, 2021

Fixed it! It was because my HEROKU_API_SECRET are an environment secret instead of a repository secret
image

Error I am getting in Github actions:

image

I think it might be an unfixed bug based on this issue:
#84

However, in the case that it is not, here are the steps on what I did:

  1. Created my main.yaml:
name: Deploy

on:
    push:
        branches:
            - main

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action
              with:
                  heroku_api_key: ${{secrets.HEROKU_API_KEY}}
                  heroku_app_name: "gh-actions-heroku" #Must be unique in Heroku
         
  1. I made sure that HEROKU_API_KEY is a secret in the github repo:
    image

  2. Pushed local repo to heroku remote repo

heroku git:remote -a gh-actions-heroku
git push heroku main

Proof that:
gh-actions-heroku is an app in my Heroku dashboard
image

Proof that it was pushed to heroku remote repo:
image

Yet I am still receiving the issue. Am I doing anything wrong?

@fabianobonomini
Copy link

same problem here

@dzcpy
Copy link

dzcpy commented Jun 24, 2022

Aame issue. What's the solution?

@danielricecodes
Copy link

I just ran into this problem; however my HEROKU_API_KEY had been set and working for nearly 6 months. I suspect Heroku may have auto-rotated my API key because all I did was update the key and now this script is working again.

TL;DR: Visit https://dashboard.heroku.com/account and update your key on Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants