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

error when nothing to commit #177

Closed
GmBodhi opened this issue Sep 25, 2021 · 9 comments
Closed

error when nothing to commit #177

GmBodhi opened this issue Sep 25, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@GmBodhi
Copy link

GmBodhi commented Sep 25, 2021

Version of the Action
v4

Describe the bug
Whenever local is up to date with origin the process fails and resulting in this error:

To Reproduce
Steps to reproduce the behavior:
Try to commit without making any changes.

Expected behavior
The process shouldn't fail and resulting in a workflow failure unless we specify to ignore the error

Screenshots
image

Used Workflow

image

@stefanzweifel
Copy link
Owner

Thanks for reporting!

Currently can't figure out what the problem here is. skip_dirt_check is covered by a test and your workflow basically uses all the default values except the commit message. 🤔

Will have a closer look over the days.

@stefanzweifel stefanzweifel added bug Something isn't working and removed changelog:changed labels Sep 25, 2021
stefanzweifel added a commit that referenced this issue Sep 25, 2021
@stefanzweifel
Copy link
Owner

@GmBodhi Unfortunately I can't reproduce your issue.

In f6048aa I've added a test that covers your exact use case (I think?). Hover, the test passes without throwing errors.

Could you share more about your use case? Pasting your workflow here would probably help.
What is happening before git-auto-commit-action is used?

@GmBodhi
Copy link
Author

GmBodhi commented Sep 25, 2021 via email

@GmBodhi
Copy link
Author

GmBodhi commented Sep 25, 2021

name: Example

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * 1"

jobs:
  Example:
    runs-on: windows-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Install Node v14
        uses: actions/setup-node@v2
        with:
          node-version: 14

      - name: Install Dependencies
        run: yarn install

      - name: Run Config
        run: yarn run config

      - name: Generate examples
        run: |
          cd example-processor
          node index.js
      - name: Generate Config
        run: |
          cd example-processor
          node generateConfig.js
      - name: Format Code
        run: |
          npm i prettier -g
          git pull -a
          prettier --write .
      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "automated: Examples generated (actions)"
          file_pattern: "."
          skip_dirty_check: false
          skip_fetch: false

That git pull -a was added for extra safety, but either way the result was same

@GmBodhi
Copy link
Author

GmBodhi commented Sep 25, 2021

It's for create-three-app, We generate webpack compatible packages from threejs.org/examples, there are plenty of them.

@GmBodhi
Copy link
Author

GmBodhi commented Sep 25, 2021

@stefanzweifel
Copy link
Owner

@GmBodhi Thanks for the links and your workflow file. The problem seems to be related to the OS you're running your jobs on: Windows.

I have written git-auto-commit to be run on UNIX based systems and not on Windows. (I currently have no intentions to support Windows. In #178 I've tried to update our test suite to run on Windows too, but that immediately failed due to the needed dependencies. I also haven't touched a Windows machine in the last 6 years.)

I've forked your project and updated the Workflow file to run on ubuntu-latest.

The run was successful and the Action created a commit: https://github.com/stefanzweifel/create-three-app/commit/3111fd6e89b12141421b1258b32993717f4ed185

Please update your Workflow file like this:

-runs-on: windows-latest
+runs-on: ubuntu-latest

I will update the README shortly to mention that the Action is not compatible with Windows.

@GmBodhi
Copy link
Author

GmBodhi commented Sep 26, 2021

Okay, thank you.

@jetersen
Copy link

https://github.com/release-drafter/release-drafter/runs/4890119635?check_suite_focus=true#step:7:35 This fails on ubuntu 😓

Invalid status code: 1

One way to fix it is:

git diff-index --quiet HEAD || git commit -m 'bla'

Or

git commit -m 'bla' || true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants