Skip to content

Conversation

kpenfound
Copy link
Contributor

Closes #180

Signed-off-by: kpenfound <[email protected]>

assemble dagger command in new step with output

Signed-off-by: kpenfound <[email protected]>

fixing some inline bash

Signed-off-by: kpenfound <[email protected]>

wrap conditional inputs in quotes

Signed-off-by: kpenfound <[email protected]>

use cat for heredoc script file

Signed-off-by: kpenfound <[email protected]>

missing space in heredoc

Signed-off-by: kpenfound <[email protected]>

add tab ignore and dagger shebang

Signed-off-by: kpenfound <[email protected]>

use toJson and jq to safely write the shell input to a file

Signed-off-by: kpenfound <[email protected]>

put DAGGER_COMMAND in a variable

Signed-off-by: kpenfound <[email protected]>

missing semicolon for the dagger command

Signed-off-by: kpenfound <[email protected]>

safely evaluate if shell is set

Signed-off-by: kpenfound <[email protected]>

extra > in shell file write

Signed-off-by: kpenfound <[email protected]>

add some logging

Signed-off-by: kpenfound <[email protected]>

strip extra newline from jq when shell is not set

Signed-off-by: kpenfound <[email protected]>

debugging

Signed-off-by: kpenfound <[email protected]>

toJSON and jq will send null instead of empty string with no input

Signed-off-by: kpenfound <[email protected]>

safely handle all inputs

Signed-off-by: kpenfound <[email protected]>

did i fix the wrong thing?

Signed-off-by: kpenfound <[email protected]>

change up the approach a bit for an easier diff

Signed-off-by: kpenfound <[email protected]>

fix shell test

Signed-off-by: kpenfound <[email protected]>

single quotes around shell input

Signed-off-by: kpenfound <[email protected]>

try with piped input

Signed-off-by: kpenfound <[email protected]>

try single quotes again

Signed-off-by: kpenfound <[email protected]>

debug

Signed-off-by: kpenfound <[email protected]>

debug

Signed-off-by: kpenfound <[email protected]>

fix shell test

Signed-off-by: kpenfound <[email protected]>

does shell emit a newline?

Signed-off-by: kpenfound <[email protected]>

remove the trailing newline if its in stdout

Signed-off-by: kpenfound <[email protected]>

break the trailing output test

Signed-off-by: kpenfound <[email protected]>

fix shell test

Signed-off-by: kpenfound <[email protected]>

missed !

Signed-off-by: kpenfound <[email protected]>

add comment about weird test

Signed-off-by: kpenfound <[email protected]>
run: |
target='${{ steps.test-shell.outputs.output }}'
result='hello world!
' # shell appears to emit an extra newline compared to call
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I suspect this is because echo includes a newline (while the call to shykes/daggerverse just directly returns a string without the newline).

We could either use the same test for both, or just use -n on the echo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah let me try with -n

version: "latest" # semver x.y.z
```
### `dagger shell`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make this the first option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe, i suspect call will still be the standard approach in ci configurations because of the named args

Signed-off-by: kpenfound <[email protected]>
@kpenfound kpenfound merged commit 4e0ad19 into dagger:main Sep 16, 2025
8 checks passed
@kpenfound kpenfound deleted the shell branch September 16, 2025 17:19
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

Successfully merging this pull request may close these issues.

✨ Improve ergonomics for dagger shell scripts
2 participants