Closed AnthonyPoschen closed 3 years ago
this issue is resolved locally with
apk add bash
not sure if more desirable to leave it as a documented requirement or to look at potentially supporting "sh" for things like alpine images that are very minimal, or potentially running the action within its own docker image with minimal requirements met.
I think this could be solved by simply updating the shebang like below.
-#!/bin/bash
+#!/bin/sh
# Remaining entrypoint.sh code …
entrypoint.sh
doesn't use specific bash
features and would allow users like you, which use their own container image for jobs to use the Action without installing additional software. Would you agree @zanven42?
The Action used Docker before v4. (We've moved to a simple node environment to allow users to use pre-commit tools like husky.)
Switching back to Docker is currently not on my radar. Not a big fan of downloading docker images/containers "just" to run a shell-script to execute a couple of git
-commands. :)
@stefanzweifel yeah that would resolve the issue perfectly fine and minimally. Still trying to find time to write my first action, since i don't get how a "simple node environment" is simpler than a tiny docker image for a run environment in the github actions world yet. If it requires less downloaded MB's then its more optimal :).
@zanven42 I've created a pull request (#167) where the Action now uses /bin/sh
instead of /bin/bash
. If you want you can test this new Action by updating your workflow like below:
-- uses: stefanzweifel/git-auto-commit-action@v4
+- uses: stefanzweifel/git-auto-commit-action@issue-166
Once the PR is merged and a new version is released, you can revert back to v4
.
I will test the changes over the next couple of days in my own projects and release a new version in the middle of the coming week.
Still trying to find time to write my first action, since i don't get how a "simple node environment" is simpler than a tiny docker image for a run environment in the github actions world yet.
As always in software development: it depends. :)
If the Action you want to write is very specific and not a "general" utitliy – like git-auto-commit
– I would definitely go down the Docker route. There you have full control over the environment.
As mentioned, in v1 to v3 this Action was using this Dockerfile. This blocked users from using the Action which were using pre-commit hooks provided by husky. As husky is such a widely used tool, I've switched the runtime from Docker to node. If I remember correctly, in v1-v3 it also took a couple of seconds to download the Docker images. It wasn't too bad. However I felt it was a unnecessary as the Action just runs some git
-commands.
Hey again.
I've commented in the PR already (https://github.com/stefanzweifel/git-auto-commit-action/pull/167#issuecomment-878517524), but wanted to update this issue too.
The problem is that git-auto-commit
actually uses bash
-features and is currently not compatible with sh
alone. (Was new to me too)
I think the easiest way to resolve this problem, is to update the README/documentation and – as you suggested in the beginning – to add a line that says that the script requires bash
. If someone uses a Docker Image like alpine
, they would have to install bash
to use git-auto-commit
.
I've added a note about the dependency to bash in the README in https://github.com/stefanzweifel/git-auto-commit-action/commit/3568db7bbcf2f869cbd3409043c0768bc912a341.
I'm closing this issue now. Thanks for reporting!
Version of the Action
v4
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior: use an alpine base container for the job with this task.
Expected behavior expect the action to run and commit / tag commits.
Screenshots https://github.com/zanven42/workflow-debugger/actions/runs/1019597903
Used Workflow
Additional context below is the logs output when starting the action. If it is known what packages are needed for this action a minimal alpine image could be setup for this action to use so that it can run in isolation cleanly and avoid this issue.