- Just 49%
- Shell 37.7%
- Nushell 13.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| .github/workflows | ||
| .idea | ||
| tests | ||
| .gitignore | ||
| action.yml | ||
| install-nushell.sh | ||
| justfile | ||
| LICENSE | ||
| README.md | ||
Action to Install Nushell
This is a Forgejo/Gitea/GitHub action to install Nushell into the current environment or container. The goal is to create a lightweight installer that works outside GitHub (i.e. in a self-hosted environment). The source lives on dev.a8n.run and is mirrored to Codeberg and GitHub.
Note: This hasn't been tested much so you may run into problems. Pull requests are welcome!
Why not setup-nu or setup_nu?
Why not use setup-nu or setup_nu instead of reinventing the wheel?
setup-nu (marketplace) uses the GitHub token for API calls. When used outside GitHub, the token is either
blank or the Forgejo/Gitea token resulting in a 401 authentication failure. setup-nu can be used only inside GitHub.
Additionally, setup-nu pulls in a 1.8MB webpack file.
setup_nu (marketplace) is a little better in that it compiles a Rust program to determine the
architecture and download Nushell. Using this outside GitHub results in an error that it couldn't find Cargo.toml.
Besides not working, pulling in the Rust toolchain just to download Nushell didn't seem efficient.
Example usage
Here's a complete example with comments.
---
on:
push:
branches:
- '**'
defaults:
run:
# Set the default shell to nu
shell: nu {0}
jobs:
nushell-action:
name: Nushell action
# This label is in the Forgejo Runner.
runs-on: ubuntu-act-22.04
steps:
-
name: Checkout code
# Use FQDN for clarity.
uses: https://code.forgejo.org/actions/checkout@v4
-
name: Install Nushell
id: nushell
# Nothing has been tagged yet. Use main.
uses: https://dev.a8n.run/pandoras-box/action-install-nushell@main
with:
nushell-version: '0.101.0'
register-plugins: true
-
name: Installed Nushell version
# This will output the Nushell version emitted from the action.
env:
NUSHELL_VERSION: ${{ steps.nushell.outputs.nushell-version }}
run: $env.NUSHELL_VERSION
-
name: Nushell version
# This will run nu's "version" command.
run: version
Inputs
set-default: Set Nushell as the default shell? This useschshto change the shell of the default user (usuallyroot).nushell-version: Nushell version to install.register-plugins: Register plugins after installation?
Outputs
nushell-version: Nushell version that was installed. Should match the input of the same name.