Repository navigation
How to properly invoke just commands in github actions with powershell? #1852
Replies: 1 comment
|
There are two shell choices here: GitHub Actions uses Your log shows the first part already works: GitHub starts For PowerShell 7 on both Linux and Windows, install/use PowerShell 7 locally too and change the justfile to: set shell := ["pwsh", "-NoLogo", "-NoProfile", "-Command"]Keep the workflow's Alternatively, leave the local justfile configuration alone and override it for the Ubuntu CI invocation: - name: Enforce code style
shell: pwsh
run: just --shell pwsh --shell-arg '-Command' ruff-show-violationsApply that override to each relevant invocation. Just's CLI shell options override the justfile settings. The installer action using Bash is independent of this: References: Just shell precedence, GitHub run defaults, PowerShell executable naming. This addresses the missing-shell error shown; I haven't run your workflow. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi! First off, thank you for this amazing tool!
I'm trying to adopt
justand I fell into some issues while setting up a CI pipeline with Github Actions (tbh I'm pretty new to this, too, so I might be overlooking something); I'd like to reference some commands from myjustfilein the Github Actions workflow, but I haven't found a way through yet. For personal preference, I'd like everything to work onpowershell.My
justfileis as follows (should run on a Windows machine):and here is part of my
.yamlfile triggering the actions:All these set, I get the following error message:
In the idea of ensuring compatibility between
set shell := ["powershell.exe", "-c"]injustfileand the setup of the default shell inactions.yaml(namely, trying to ensure alignment between the local execution environment and the Linux environment the Github Actions workflow runs on), I've tried to play around with these two with no luck. Neither settingpwshnorpowershellas default shell seems to work; specifying the shell at the level of single steps (withshell:option) doesn't work as well.Can anyone help? Perhaps it should be better asked in https://github.com/taiki-e/install-action, but this repo is missing the Discussions tab.
Thank you in advance!
Update
I could get a working configuration while setting up everything to run on
bash, but I'm yet to find a way to make it work onpowershell. Plus, I noticed that - no matter what the default shell configuration inactions.yaml-taiki-e/install-action@justseems to always run onbash(and nowith: shell:option to force a different behaviour is provided).All reactions