Skip to content

Commit e88e2e7

Browse files
fixes
1 parent 811cb07 commit e88e2e7

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

action.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ name: 'Run ConneKt Scripts'
22
description: 'Run a list of scripts inside a container with environment setup'
33

44
inputs:
5-
scripts_path:
6-
description: 'Path to local directory with scripts'
7-
required: true
8-
scripts_list:
9-
description: 'List of scripts to execute (newline separated)'
5+
files:
6+
description: 'List of full paths to scripts to execute (newline separated)'
107
required: true
118
env_file:
129
description: 'Path to env file (connekt.env.json)'
@@ -24,17 +21,21 @@ runs:
2421
steps:
2522
- name: Run Scripts Inside Docker
2623
run: |
27-
echo "${{ inputs.scripts_list }}" | while read script; do
28-
if [ -n "$script" ]; then
29-
echo "Running $script..."
24+
echo "${{ inputs.files }}" | while read filepath; do
25+
if [ -n "$filepath" ]; then
26+
filename=$(basename "$filepath")
27+
dirpath=$(dirname "$filepath")
28+
29+
echo "Running $filename from $dirpath..."
30+
3031
docker run --rm \
3132
--add-host=host.docker.internal:host-gateway \
32-
-v ${{ inputs.scripts_path }}:/connekt/scripts \
33+
-v "$dirpath":/connekt/scripts \
3334
-v ${{ inputs.env_file }}:/connekt/scripts/connekt.env.json \
3435
${{ inputs.image }} \
3536
--env-name=${{ inputs.env }} \
3637
--env-file=scripts/connekt.env.json \
37-
--script=scripts/$script
38+
--script=scripts/"$filename"
3839
fi
3940
done
4041
shell: bash

0 commit comments

Comments
 (0)