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
1.98k stars 227 forks source link

Invalid status code: 128 #121

Closed clxmstaab closed 3 years ago

clxmstaab commented 3 years ago

since today morning we are running into errrors:

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

our workflow looks like (which did not change for a few days now):

name: Static analysis

on:
  pull_request:
  repository_dispatch:
    types: [phpstan-baseline-command] # triggered by /phpstan-baseline PR comment

jobs:

  phpstan:
    name: PHPStan
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, '[ci skip]')"

    steps:
    - uses: actions/checkout@v2
      with:
        token: ${{ secrets.STAABM_TOKEN }}
        repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
        ref: ${{ github.event.client_payload.pull_request.head.ref }}

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 7.4
        coverage: none
        tools: cs2pr

    - name: Get composer cache directory
      id: composer-cache
      run: echo "::set-output name=dir::$(composer config cache-files-dir)"

    - name: Cache dependencies
      uses: actions/cache@v2
      with:
        path: ${{ steps.composer-cache.outputs.dir }}
        key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
        restore-keys: ${{ runner.os }}-composer-

    - run: |
        composer config scripts.post-install-cmd --unset # disable post-install-cmd in composer.json
        composer install --prefer-dist --no-progress --no-suggest # install the apps dependencies
        composer bin phpstan install --no-progress

    - run: composer phpstan-baseline # generate baseline
      if: "github.event_name == 'repository_dispatch'"

    - name: Commit changed files
      if: "github.event_name == 'repository_dispatch'"
      uses: stefanzweifel/git-auto-commit-action@v4
      with:
        commit_message: Apply phpstan-baseline changes
        branch: ${{ github.head_ref }}
        file_pattern: '*.neon' # make sure we don't commit our locally changed composer.json

    - run: composer phpstan-pull-request
      if: "github.event_name != 'repository_dispatch'"

is this something related to the recent 2 releases from today, which got reverted?

https://github.com/stefanzweifel/git-auto-commit-action/releases/tag/v4.7.1

alvarosanchez commented 3 years ago

Same here: https://github.com/micronaut-projects/micronaut-starter/runs/1289126502?check_suite_focus=true

clxkoders commented 3 years ago

duplicate of https://github.com/stefanzweifel/git-auto-commit-action/issues/119, so 4.7.1 should contain a fix ?

clxmstaab commented 3 years ago

hmm it seems the v4 tag is not up 2 date then?

stefanzweifel commented 3 years ago

Thanks for reporting and sorry for the inconvenience!

As @clxkoders mentioned, I've reverted the changes in v4.7.0 and released v4.7.1. The v4 has also been automatically been updated to point to the latest release: https://github.com/stefanzweifel/git-auto-commit-action/releases

A quick test in my demo repo also showed, that the Action works as expected: https://github.com/stefanzweifel/git-auto-commit-action-demo-app/pull/22

Does the error still persist?

alvarosanchez commented 3 years ago

Thank you for your great action and the quick response, shit happens sometimes.

We will check our next executions and see if anything goes wrong.

efeubiqube commented 3 years ago

Thanks for reporting and sorry for the inconvenience!

As @clxkoders mentioned, I've reverted the changes in v4.7.0 and released v4.7.1. The v4 has also been automatically been updated to point to the latest release: https://github.com/stefanzweifel/git-auto-commit-action/releases

A quick test in my demo repo also showed, that the Action works as expected: stefanzweifel/git-auto-commit-action-demo-app#22

Does the error still persist?

@stefanzweifel

I just run twice. Still occurs to me. Does github have a cache maybe?

Edit: Using @v4 or @v4.7.1

clxmstaab commented 3 years ago

the error is still reproducible on my end

stefanzweifel commented 3 years ago

I've deleted and recreated the v4 tag to point to v4.6.0 again. Have to check if and how I could remove v4.7.0 completely.

clxmstaab commented 3 years ago

it works again, thx!