CircleCI-Public / slack-orb

Create custom Slack notifications for CircleCI job statuses
https://circleci.com/developer/orbs/orb/circleci/slack
MIT License
212 stars 205 forks source link

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

Open martin-displayr opened 8 months ago

martin-displayr commented 8 months ago

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: https://github.com/CircleCI-Public/slack-orb/pull/380#issuecomment-1778648385

KyleTryon commented 7 months ago

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