Originally forked from https://github.com/hustcer/setup-nu/, many thanks to [hustcer](https://github.com/hustcer
This GitHub Action will setup a Couchbase Shell environment for you.
In most cases you just need to specify the version
of Nushell to be used in your workflow.
For example the following installs the v0.80
version of Nushell.
Then you can set the command you want to run in the following steps, and don't forget to set shell: nu {0}
to make the commands be executed by nu
:
- uses: ldoguin/setup-cbsh@v1
with:
version: "v0.75.2" # Don't use 0.90 here, as it was a float number and will be convert to 0.9, you can use v0.90/0.90.0 or '0.90'
- run: print $'Nu version info:(char nl)'; version
shell: cbsh {0}
- name: Default shell will be `nu`
shell: cbsh {0}
run: |
print $'Nu path:(which cbsh)(char nl)'
def greeting [name: string] {
print $'Hello ($name)'
}
greeting hustcer
Of cause, You can also set the default shell to cbsh
by setting the defaults.run.shell
config:
name: basic
on: push
defaults:
run:
shell: cbsh {0}
jobs:
basic-usage:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ldoguin/setup-cbsh@main
with:
version: "*"
- run: version; print $"(char nl)Dir contents:(char nl)"; ls ((which cbsh).path.0 | path dirname)
- run: |
print $'Current env:(char nl)'
print $env
- name: You can run bash commands, too
run: pwd && ls -la
shell: bash
Licensed under:
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)