[BUG] Forgejo Actions is missing fallback shell support #150
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: forgejo/runner#150
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
(See also https://codeberg.org/forgejo/forgejo/issues/2357)
Description
According to the GitHub docs, the default behaviour if a step does not set its own shell is to use
bash
and fall back tosh
if bash is not available. However, Forgejo Actions just fail if bash is not found:Forgejo Version
1.21.5+0
Operating System
Debian
How are you running Forgejo?
docker
Database
PostgreSQL
Interestingly, the code suggests it (= act, which the runner uses under the hood to run the workflow) should try
sh
too. I wonder why that doesn't work... perhaps there's something else that implicitly sets the shell to bash before this code is reached?Nitpicking: note that I'm tagging this as a feature rather than a bug, simply because there is no promise to be 100% compatible with GitHub Actions.
Can you provide screenshots or the log file? The attachment doesn't exist.
Hm, well then codeberg does something weird where it does not serve the image when requested from another domain? Anyways, here's a re-upload:
Not sure if that's the screenshot you're looking for though, let me know if you need something else
Could you provide the link to your workflow so we can test it out? And what image is your runner using?
I have just finished setting up a workflow to auto build and deploy my website built with Hugo and I don't have this issue, it could be because I use this image instead: https://github.com/catthehacker/docker_images
@Xinayder I'm not going to publish my repository, but I'm using
alpine-latest
which is mapped to thealpine:latest
docker image. Using docker images that come with bash like the ones from catthehacker obviously don't run into the problem that bash is not available.This would be the workflow at the time I took the screenshot:
The working version I'm using right now would be the following, where I had to explicitly set the shell I'm using:
If this is the case that the
alpine-latest
tag is mapped toalpine:latest
image then there's nothing wrong, as Alpine doesn't shipbash
by default. You could probably fix that by addingbash
to the list of packages to be installed, unless I misunderstood the problem.EDIT: okay, the problem is that the runner just fails without falling back to
sh
.I know that alpine doesn't ship
bash
. I'm not asking for forgejo to magically spawn abash
. I'm asking for forgejo to fall back tosh
ifbash
is not available, like it is explained as the "default behaviour" in the github docs I linked in my initial post.Well ... that command already needs a shell to execute it.
I think I know where the problem is. Will have a go at it tomorrow, and report back.
I setup a test repo to replicate the issue and I had to explicitly set the shell to
bash
for it to fail:So, I guess the step shouldn't fail if the shell isn't found, falling back to
sh
if, in the example above,bash
is not found?EDIT: link to my test repo https://codeberg.org/Xinayder/runner-tests/src/branch/main/.forgejo/workflows/shell.yaml
@Xinayder In your example, it is fine to fail as you explicitly request
bash
. For me, it failed in the first step already, where no shell was explicitly requested. I'll see if I can set up a repro later.@Xinayder I got a working repro: https://msrd0.dev/msrd0/runner-test/actions/runs/1
I've set up the runner using docker-compose:
and these are the labels in the
config.yml
file: