question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Push the commit or tag' step fails with: "The process '/usr/bin/git' failed with exit code 1" using force_orphan

See original GitHub issue

Describe the bug

After making an update today, the Action kicked off, but produced the following error in the Push the commit or tag step:

  /usr/bin/git push origin --force gh-pages
  error: src refspec gh-pages does not match any
  error: failed to push some refs to 'https://github.com/decentralized-identity/presentation-exchange.git'
  Error: Action failed with "The process '/usr/bin/git' failed with exit code 1"

The Action was working just a day or so ago, but produced this error today, and I am not sure why. The only difference was that the push was via an inline change in the main GH repo, and now every run fails at this step, regardless of the change or where it is made.

To Reproduce

  1. Make any update that triggers the Action
  2. The Push the commit or tag step fails

Expected behavior

Is able to push the commit it tries to generate.

Your YAML file

name: render-specs

on:
  push:
    branches:
      - master

jobs:
  build-and-deploy-spec:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v2
        with:
          persist-credentials: false

      - name: Install and Build
        run: |
          npm install
          node -e "require('spec-up')({ nowatch: true })"
          rm -rf node_modules

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3.7.2
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./
          force_orphan: true

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
csuwildcatcommented, Oct 16, 2020

@peaceiris I tried the first suggested revision, d38d8b3, and just ran it twice from an external commit and direct commit to master from the GH GUI and both times it worked. Not sure what is different, but that seemed to do the trick!

1reaction
csuwildcatcommented, Oct 16, 2020

The reason I mentioned it is that there seems to be a common cause cited in the results I have been looking at from folks who have seen this message outside of this Action, in general git usage:

“The ‘src refspec <branch> does not match any’ error occurs if you have forgotten to add the files you have changed to a commit and try to push those changes to a remote repository before you make the first commit in your repository.”

Read more comments on GitHub >

github_iconTop Results From Across the Web

exit code 1 received" when trying to commit a new local ...
I removed the repository from GitHub Desktop (not from the disk) and then added it again as a local repository and this solved...
Read more >
How to Fix 'failed to push some refs to' Git Errors - Komodor
A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do...
Read more >
Git Push | Atlassian Git Tutorial
Pushing is how you transfer commits from your local repository to a remote repo. Learn how to use git push with this tutorial....
Read more >
Git push rule Commit message blocking semantic release
Steps to reproduce ... [1:49:13 PM] [semantic-release] › ✖ An error occurred while ... Error: Command failed with exit code 1: git push...
Read more >
git-fetch Documentation - Git
By using a refspec that fetches tags explicitly, you can fetch tags that do not point ... Either all refs are updated, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found