File tree Expand file tree Collapse file tree 1 file changed +47
-1
lines changed Expand file tree Collapse file tree 1 file changed +47
-1
lines changed Original file line number Diff line number Diff line change 27
27
run : npm install
28
28
29
29
- name : NPM Build
30
- run : SERVER_ROOT=https://playground.accordproject.org && NODE_OPTIONS=--max_old_space_size=8192 npm run build
30
+ run : SERVER_ROOT=https://playground.accordproject.org && NODE_OPTIONS=--max_old_space_size=8192 npm run build
31
+
32
+ check-sensitive-files :
33
+ name : Check for Sensitive Files
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ - name : Checkout code
37
+ uses : actions/checkout@v2
38
+
39
+ - name : Get Changed Files
40
+ id : get_changed_files
41
+ uses : tj-actions/changed-files@v45
42
+
43
+ - name : Check for Unauthorized Changes
44
+ run : |
45
+ RESTRICTED_FILES=(
46
+ ".github/workflows/"
47
+ "package.json"
48
+ "package-lock.json"
49
+ "Dockerfile"
50
+ "docker-compose.yml"
51
+ ".env.example"
52
+ )
53
+
54
+ UNAUTHORIZED_CHANGES=""
55
+
56
+ for file in ${{ steps.get_changed_files.outputs.all_changed_files }}; do
57
+ for restricted in "${RESTRICTED_FILES[@]}"; do
58
+ if [[ "$file" == *"$restricted"* ]]; then
59
+ echo "❌ Unauthorized change detected: $file"
60
+ UNAUTHORIZED_CHANGES="$UNAUTHORIZED_CHANGES\n$file"
61
+ fi
62
+ done
63
+ done
64
+
65
+ if [[ ! -z "$UNAUTHORIZED_CHANGES" ]]; then
66
+ echo -e "⛔ Unauthorized changes detected in:\n$UNAUTHORIZED_CHANGES"
67
+ exit 1
68
+ else
69
+ echo "✅ No unauthorized changes detected. Proceeding..."
70
+ fi
71
+ shell : bash
72
+
73
+
74
+
75
+
76
+
You can’t perform that action at this time.
0 commit comments