Skip to content

Commit f4312ae

Browse files
author
Tom Brandenburg
committed
fix: add bash execution guard to handle CI environments using sh
- Add bash version check at start of generated scripts - Auto-reexecute with bash if running under sh/dash - Prevents 'Illegal option -o pipefail' errors in GitHub Actions - Ensures bash-specific features work regardless of CI shell environment
1 parent 1d78d98 commit f4312ae

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/generation/shell-generator.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ function generateHeader(workflow: FlowshWorkflow, options: GenerationOptions): s
362362
const shell = options.shell === 'zsh' ? 'zsh' : 'bash';
363363

364364
return `#!/bin/${shell}
365+
# Ensure we're running with bash (handle CI environments that might default to sh)
366+
if [ -z "$BASH_VERSION" ]; then
367+
exec bash "$0" "$@"
368+
fi
369+
365370
set -euo pipefail
366371
367372
# ${name} - Generated by flowsh

0 commit comments

Comments
 (0)