Skip to content

Commit 6eed0b5

Browse files
committed
put back script in action file
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 0a0f728 commit 6eed0b5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

action.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,28 @@ runs:
101101
sudo -u postgres psql -c "ALTER USER $SCANCODEIO_DB_USER WITH ENCRYPTED PASSWORD '$SCANCODEIO_DB_PASSWORD'"
102102
sudo -u postgres createdb --owner=scancodeio --encoding=UTF-8 "$SCANCODEIO_DB_NAME"
103103
104-
- name: Install scanpipe wrapper script
104+
- name: Write scanpipe wrapper script
105105
shell: bash
106106
run: |
107-
cp "${{ github.action_path }}/scripts/scanpipe.sh" "$RUNNER_TEMP/scanpipe"
107+
cat > "$RUNNER_TEMP/scanpipe" << 'EOF'
108+
#!/usr/bin/env bash
109+
set -euo pipefail
110+
exec docker run --rm \
111+
--network host \
112+
--user "$(id -u):$(id -g)" \
113+
--cap-drop ALL \
114+
--security-opt no-new-privileges \
115+
-e SECRET_KEY \
116+
-e SCANCODEIO_DB_NAME \
117+
-e SCANCODEIO_DB_USER \
118+
-e SCANCODEIO_DB_PASSWORD \
119+
-e SCANCODEIO_DB_HOST=localhost \
120+
-e SCANCODEIO_WORKSPACE_LOCATION \
121+
-e HOME=/workspace/.home \
122+
-v "$GITHUB_WORKSPACE:/workspace" \
123+
"$SCANCODEIO_IMAGE" \
124+
scanpipe "$@"
125+
EOF
108126
chmod +x "$RUNNER_TEMP/scanpipe"
109127
echo "$RUNNER_TEMP" >> "$GITHUB_PATH"
110128

0 commit comments

Comments
 (0)