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

Orb should work even if the default shell is not bash #429

Open
martin-displayr opened this issue Oct 26, 2023 · 6 comments
Open

Orb should work even if the default shell is not bash #429

martin-displayr opened this issue Oct 26, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@martin-displayr
Copy link

martin-displayr commented Oct 26, 2023

Orb version:

4.12.5

What happened:

When using a Windows runner and Powershell as the shell for the job, the orb fails:

eval : The term 'eval' is not recognized as the name of a cmdlet, function, script file, or operable program. Check 
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:6 char:1
+ eval printf '%s' "$SLACK_SCRIPT_NOTIFY"
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (eval:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 

Exited with code exit status 1

Expected behavior:

You can use any shell at the job level, and the orb just works.

I think this should be possible, the orb just needs to specify to run it's commands using bash.exe ?

Additional Information:

Workaround for me is to set the job level shell to bash, then override to powershell for every job. This works in a Windows runner.

Related: #380 (comment)

@martin-displayr martin-displayr added the bug Something isn't working label Oct 26, 2023
@KyleTryon
Copy link
Contributor

Hey, I just wanted to share here that we are nearly about to release the beta version of a re-write of this orb in Go. I'll post here again with information for upgrading to the beta test. eval is no longer supported in the go version, so this should be resolved. The only hard requirement we believe will be needed is either CURL or WGET

@alxDisplayr
Copy link

alxDisplayr commented Aug 7, 2024

Seems like the go orb was made, just not sure how maintained it is? https://github.com/CircleCI-Public/slack-orb-go
Which should we be using? Seems like the go orb doesn't have thread support yet.

@marboledacci
Copy link
Contributor

The development of the go version for this orb is now on stand by, but I'm addressing this issue in the next release. The orb will enforce the usage of bash, no matter the shell on the executor.

@marboledacci marboledacci self-assigned this Sep 11, 2024
@marboledacci
Copy link
Contributor

The version 4.14.0 of the orb is now using bash only to run the scripts.

@gavinclarkeuk
Copy link

Switching to bash breaks any use of the orb on alpine based images, as they don't include bash by default.

@marboledacci
Copy link
Contributor

Hi @gavinclarkeuk we're starting to standardize the orbs to use bash only, I'll add more information on the orb version to let this constraint clear.
This orb still supports alpine, but only with bash. You can install bash directly or use an alpine based image that comes with bash.

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

5 participants