File tree Expand file tree Collapse file tree 2 files changed +27
-9
lines changed
Expand file tree Collapse file tree 2 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 3737 image : ' Dockerfile'
3838 env :
3939 TYPSTIFY_WORKING_DIR : ${{ inputs.working-directory }}
40- args :
41- - ${{ inputs.command }}
42- - ' --config'
43- - ${{ inputs.config }}
44- - ' --output'
45- - ${{ inputs.output }}
Original file line number Diff line number Diff line change 22set -e
33
44# Change to working directory if specified
5- if [ -n " $TYPSTIFY_WORKING_DIR " ] && [ " $TYPSTIFY_WORKING_DIR " != " ." ]; then
5+ if [ -n " $INPUT_WORKING_DIRECTORY " ] && [ " $INPUT_WORKING_DIRECTORY " != " ." ]; then
6+ cd " $INPUT_WORKING_DIRECTORY "
7+ elif [ -n " $TYPSTIFY_WORKING_DIR " ] && [ " $TYPSTIFY_WORKING_DIR " != " ." ]; then
68 cd " $TYPSTIFY_WORKING_DIR "
79fi
810
9- # Execute typstify with all arguments
10- exec typstify " $@ "
11+ # If arguments are provided (via args in action.yml or manual override), execute them directly
12+ if [ $# -gt 0 ]; then
13+ exec typstify " $@ "
14+ fi
15+
16+ # Otherwise, construct command from inputs
17+ # Note: --config is a global argument and must be placed before the subcommand
18+ CMD=" typstify --config ${INPUT_CONFIG:- config.toml} "
19+ SUBCOMMAND=" ${INPUT_COMMAND:- build} "
20+
21+ CMD=" $CMD $SUBCOMMAND "
22+
23+ # Add subcommand specific arguments
24+ if [ " $SUBCOMMAND " = " build" ]; then
25+ CMD=" $CMD --output ${INPUT_OUTPUT:- public} "
26+
27+ if [ " $INPUT_DRAFTS " = " true" ]; then
28+ CMD=" $CMD --drafts"
29+ fi
30+ fi
31+
32+ # Execute the constructed command
33+ echo " Executing: $CMD "
34+ exec $CMD
You can’t perform that action at this time.
0 commit comments