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

fatal: invalid refspec 'HEAD:' #148

Closed reypm closed 3 years ago

reypm commented 3 years ago

I am running into https://github.com/stefanzweifel/git-auto-commit-action/issues/8 and I am not sure why since I am leaving the value as defaulted which should be the current branch. What I could be missing here?

name: Code Style

on: [push]

jobs:
  php-cs-fixer:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Run PHP CS Fixer
        uses: docker://oskarstark/php-cs-fixer-ga
        with:
          args: --config=.php_cs.dist

      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v2.3.0
        with:
          commit_message: Fix styling
        env:
          GITHUB_TOKEN: ${{ secrets. GITHUB_TOKEN }}
stefanzweifel commented 3 years ago

The easiest solution here is to upgrade to the latest version of git-auto-commit.

 name: Code Style

 on: [push]

 jobs:
   php-cs-fixer:
     runs-on: ubuntu-latest

     steps:
       - name: Checkout code
         uses: actions/checkout@v2

       - name: Run PHP CS Fixer
         uses: docker://oskarstark/php-cs-fixer-ga
         with:
           args: --config=.php_cs.dist

       - name: Commit changes
-        uses: stefanzweifel/git-auto-commit-action@v2.3.0
+        uses: stefanzweifel/git-auto-commit-action@v4
         with:
           commit_message: Fix styling

Note that the GITHUB_TOKEN no longer has to be passed to the Action since v3.0.0.

reypm commented 3 years ago

Excellent! that fixed my issue! Thank you a lot!!