Closed MatthijsBurgh closed 1 year ago
Thanks for reporting!
Even if it should be obvious that git
is required for this action to work, adding a little check at the beginning of the script and then failing hard if git
can't be found, shouldn't be too complex.
Will add this in the upcoming days.
After manually installing git just before running this action. I get the following error. (src)
/usr/bin/docker exec af011818fd5442280ae04551d713f43af5ca547e518cc81ce1c146d5fded6e68 sh -c "cat /etc/*release | grep ^ID"
Started: bash /__w/_actions/stefanzweifel/git-auto-commit-action/v4/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_STATUS_OPTIONS:
INPUT_FILE_PATTERN: build/*.js
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Working tree clean. Nothing to commit.
Because there wasn't any git in the container. The checkout
action just downloaded the repo via the REST API. Therefore the files are there, but the folder isn't a git repo. I think this error is also created in the _git_is_dirty
function. In such an event, it would also be nice to let the action end with an error.
I've updated the Action to check if git is available at the very beginning of the execution flow (#261). If the binary is missing, the run is stopped and a proper error message is displayed.
This should hopefully also cover the behaviour you mentioned.
A new version has been tagged. If you've been using v4
in your workflows, you don't have to update anything.
Thanks again for reporting this issue and helping making this action a bit better.
Thanks for the fix!
git-auto-commit Version
V4
Machine Type
Ubuntu (eg. ubuntu-latest)
Bug description
I am using the
container
option of GH actions. My container doesn't have git installed. So your script tries to call git, but it doesn't exist.I would expect your action would fail in that case. But it doesn't. It just exits with success.
Steps to reproduce
Use the container option of a job in GH actions in combination with a container without git installed.
Tried solutions
Temporary workaround is just to install git manually.
Example Workflow
Relevant log output