-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
53 lines (44 loc) · 1.17 KB
/
entrypoint.sh
File metadata and controls
53 lines (44 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
set -e
# Arguments from action.yml
FORMAT="${1:-mp4}"
OUTPUT_PATH="${2:-timelapse.mp4}"
BRANCH="${3:-}"
RESOLUTION="${4:-1080p}"
FPS="${5:-2}"
INCLUDE="${6:-}"
EXCLUDE="${7:-}"
REDACT_SECRETS="${8:-false}"
AUTHOR_COLORS="${9:-false}"
# Build command
CMD="python -m src.main /github/workspace ${OUTPUT_PATH} --format ${FORMAT} --resolution ${RESOLUTION} --fps ${FPS}"
# Add optional branch
if [ -n "$BRANCH" ]; then
CMD="$CMD --branch $BRANCH"
fi
# Add include patterns (comma-separated)
if [ -n "$INCLUDE" ]; then
IFS=',' read -ra PATTERNS <<< "$INCLUDE"
for pattern in "${PATTERNS[@]}"; do
CMD="$CMD --include \"$pattern\""
done
fi
# Add exclude patterns (comma-separated)
if [ -n "$EXCLUDE" ]; then
IFS=',' read -ra PATTERNS <<< "$EXCLUDE"
for pattern in "${PATTERNS[@]}"; do
CMD="$CMD --exclude \"$pattern\""
done
fi
# Add redact-secrets flag
if [ "$REDACT_SECRETS" = "true" ]; then
CMD="$CMD --redact-secrets"
fi
# Add author-colors flag
if [ "$AUTHOR_COLORS" = "true" ]; then
CMD="$CMD --author-colors"
fi
echo "Running: $CMD"
eval $CMD
# Set output for GitHub Actions
echo "output-file=${OUTPUT_PATH}" >> $GITHUB_OUTPUT