-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathentrypoint.sh
More file actions
38 lines (30 loc) · 868 Bytes
/
entrypoint.sh
File metadata and controls
38 lines (30 loc) · 868 Bytes
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
#!/bin/bash
# ------------------------------------------------------
# Main Entrypoint Orchestrator
# ------------------------------------------------------
# 1. Setup Global Variables
export output_file=./output.log
echo "Server URL: $GITHUB_SERVER_URL"
# 2. Determine Environment (Cloud vs On-Prem)
if [ "$GITHUB_SERVER_URL" = "https://github.com" ]; then
echo "Detected GitHub Cloud"
export IS_CLOUD=true
else
echo "Detected GitHub Enterprise Server"
export IS_CLOUD=false
fi
# A. Multi-Registry Authentication
source /app/scripts/auth.sh
# B. Scan Execution
source /app/scripts/scan.sh
# C. PR Decoration
source /app/scripts/pr_decoration.sh
# D. Results Reporting
source /app/scripts/results.sh
# 4. Final Exit Handling
if [ $exitCode -eq 0 ]; then
echo "Scan completed successfully."
else
echo "Scan failed."
exit $exitCode
fi