stefanzweifel / git-auto-commit-action

Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
MIT License
2.02k stars 229 forks source link

broken commit action with v4.7.0 #119

Closed jenschude closed 4 years ago

jenschude commented 4 years ago

Version of the Action v4.7.0

Describe the bug

With the latest release (4.7.0) I got this bug:

Started: bash /home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_BRANCH value: 

<snip....>

fatal: invalid reference: 
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  code: 128
}
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

To Reproduce

My relevant action configuration

      - name: Checkout
        uses: actions/checkout@v2

      - uses: stefanzweifel/git-auto-commit-action@v4.6.0
        with:
          commit_message: "TASK: Updating version in README"
          commit_user_name: Auto Mation
          commit_user_email: automation@...
          commit_author: Auto Mation <automation@...>

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Used Workflow


# Paste the Workflow you've used here

Additional context Add any other context about the problem here.

Lego6245 commented 4 years ago

I can confirm that reverting to v4.6.0 will result in the action working as expected.

stefanzweifel commented 4 years ago

Argh! Wasn't my intention. 😓

The changes made in v4.7.0 have been reverted in #120 and a new version has been released: v4.7.1

jenschude commented 4 years ago

Totally fine. Thanks for the fast reaction 🥇

encap commented 4 years ago

Thanks for the fast reaction. I was looking for this issue this morning but I didn't expect that it would be closed already so I didn't see it. The moral of this story: Always specify patch version not just @v4

AnandChowdhary commented 4 years ago

v4.7.1 is also breaking for me 😢 https://github.com/carlobadini/life/runs/1295722644?check_suite_focus=true

AnandChowdhary commented 4 years ago

The only difference I see between v4.6.0 and v4.7.1 is using "--" after branches in git operations: https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.6.0...v4.7.1. Is this something that could be causing it?

stefanzweifel commented 4 years ago

Yeah. Totally forgot to add this change to the changelog (or revert it).

The worrying thing for me right now is, that I can't reliably reproduce the error "fatal: invalid reference:". My tests with v4.7.0 and v4.7.1 worked. 😐

I have to further read through the logs you all send me, but I think the culprit lies in the fact, that maybe $INPUT_BRANCH is empty and causes an issue.

Over the next few days I will build some sort of matrix with all possible trigger-combinations and will make sure to test every single one of those combinations.


Not directly related to this issue, but the test suite which mocks git also started to fails 7 days ago. The only change between a commit where it worked and a commit where it didn't work anymore was a README update. 🤷 https://github.com/stefanzweifel/git-auto-commit-action/runs/1294146596?check_suite_focus=true

AnandChowdhary commented 4 years ago

Over the next few days I will build some sort of matrix with all possible trigger-combinations and will make sure to test every single one of those combinations.

That would be amazing! For the time being, do you think you can "hard" reset to v4.6.0 and release a new v4.7.2 (essentially making sure that the https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.6.0...v4.7.1 diff is only the CHANGELOG) by reverting the other changes as well? This would fix currently breaking workflows for people using stefanzweifel/git-auto-commit-action@master or those like me who have Dependabot setup to stay on the latest versions.

stefanzweifel commented 4 years ago

@AnandChowdhary Just tagged v4.7.2 which reverts entrypoint.sh to the state of v4.6.0.

AnandChowdhary commented 4 years ago

I have tested this and v4.7.2 works perfectly. Thanks! 😄