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

Push rejected to ***. #127

Open
kimmy-wang opened this issue Apr 30, 2022 · 5 comments
Open

Push rejected to ***. #127

kimmy-wang opened this issue Apr 30, 2022 · 5 comments

Comments

@kimmy-wang
Copy link

kimmy-wang commented Apr 30, 2022

screenshot-20220430-204631

截屏2022-04-30 20 41 01

@chenly
Copy link

chenly commented May 1, 2022

add this line beforce uses: akhileshns/[email protected]

  - run: git pull

@kimmy-wang
Copy link
Author

kimmy-wang commented May 1, 2022

add this line beforce uses: akhileshns/[email protected]

  - run: git pull

heroku-deploy/index.js

Lines 223 to 233 in 79ef2ae

try {
deploy({ ...heroku, dontuseforce: true });
} catch (err) {
console.error(`
Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch.
(If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml.
Specifically, the error was: ${err}
`);
deploy(heroku);
}

I read the source code of this project and found that regardless of whether you have set the value of dontuseforce in the code, the value of this variable dontuseforce will be overwritten to true. Only after this code runs and reports an error, the value of this variable dontuseforce will not be overwritten, even with the original value of the variable.

The error message in the first picture is misleading, you should actually look at the error message in the second picture.

@ronvohra
Copy link

ronvohra commented May 5, 2022

I've got the same issue.

@cansin
Copy link

cansin commented May 19, 2022

We were having a similar issue (if not the same). Turns out we forgot to add our bot account to the Heroku application (with Deploy access). Doing that, plus the below deploy.yml works for us currently:

name: Deploy

concurrency:
  group: deploy
  cancel-in-progress: false

on:
  push:
    branches:
      - master

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Deploy code
        uses: akhileshns/[email protected]
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: "sample-app-name"
          heroku_email: "[email protected]"
          team: "sample-team"
          dontuseforce: true
          dontautocreate: true

Hope this helps someone.

@harastaivan
Copy link

Make sure you regenerate your Heroku API key. It helped in my case.

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

5 participants