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

justfile does not preserver the command exit code #2328

Open
a0m0rajab opened this issue Aug 28, 2024 · 1 comment
Open

justfile does not preserver the command exit code #2328

a0m0rajab opened this issue Aug 28, 2024 · 1 comment

Comments

@a0m0rajab
Copy link

i have the next just file, when I have an error in the dotnet build code, the build returns 1 exit code, yet just files does not return that code to use with GitHub actions in the CI/CD, how can I get the exit code from the dotnet build and use it in the action?

null:

clean:
    abp clean && dotnet clean && dotnet nuget locals all --clear

build:
    export $(grep -v '^#' .env | xargs) && dotnet build -nologo -verbosity:quiet -graph || exit $?
@laniakea64
Copy link
Contributor

On Xubuntu 22.04, with just latest master and this test justfile...

test:
	sh -c 'exit 3' || exit $?

... just does return the failure exit code -

$ just ; echo $?
sh -c 'exit 3' || exit $?
error: Recipe `test` failed on line 2 with exit code 3
3

What OS is your action running in?
What shell is just using for your justfile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants