EndBug / add-and-commit

:octocat: Automatically commit changes made in your workflow run directly to your repo
MIT License
1.13k stars 116 forks source link

False reporting of Working tree clean. Nothing to commit. #616

Closed theofficialgman closed 7 months ago

theofficialgman commented 8 months ago

workflow: https://github.com/Botspot/pi-apps/actions/runs/7676529394/workflow

working tree is checked for any changes with git diff HEAD --name-only and the output is

apps/Oh My Posh/install
apps/Pycharm CE/install-64

https://github.com/Botspot/pi-apps/actions/runs/7676529394/job/20924363545#step:5:41 these are files that already exist in the git repo but have been modified.

however running EndBug/add-and-commit@v9 results in a false report that the working tree is clean.

Internal logs
  > Staging files...
  > Adding files...
  > No files to remove.
  > Checking for uncommitted changes in the git working tree...
> Working tree clean. Nothing to commit.
Outputs
  committed: false
  commit_long_sha: undefined
  commit_sha: undefined
  pushed: false
  tagged: false
  tag_pushed: false

https://github.com/Botspot/pi-apps/actions/runs/7676529394/job/20924363545#step:7:36

theofficialgman commented 8 months ago

removing the with

          fetch: false
          add: '--refresh'

works around this issue (not ideal since I do not want to add any potential new files to the repo). however now the same issue as mentioned here occurs -> https://github.com/stefanzweifel/git-auto-commit-action/issues/317

EndBug commented 8 months ago

Hey, thanks for opening this issue! Does this also happen if you use add: '-A'?

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.