Skip to content

Commit 00126f1

Browse files
authored
Merge pull request qualcomm-linux#134 from smuppand/rproc
Fix: Enforce executable permissions via workflow and restore +x on gpdsp test
2 parents 578e1b3 + dd2fb3f commit 00126f1

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed
Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,56 @@
11
name: Enforce Script Executable Permissions
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
branches: [ "main" ]
66
paths:
77
- '**/run.sh'
88
- '**/*.sh'
9+
910
push:
1011
branches: [ "main" ]
12+
paths:
13+
- '**/run.sh'
14+
- '**/*.sh'
15+
1116
workflow_dispatch:
1217

1318
jobs:
1419
permissions:
20+
name: Check script permissions
1521
runs-on: ubuntu-latest
22+
1623
steps:
1724
- name: Checkout code
1825
uses: actions/checkout@v4
1926

20-
- name: Detect missing executable permissions on shell scripts
27+
- name: Check for missing +x on shell scripts
2128
run: |
22-
# Find all .sh and run.sh scripts without +x
29+
echo "🔍 Checking shell script permissions..."
2330
BAD=$(find . -type f \( -name "*.sh" -o -name "run.sh" \) ! -perm -u=x)
31+
2432
if [ -n "$BAD" ]; then
25-
echo "::error file=run.sh,line=1::❌ Some shell scripts are missing executable permissions. This can break CI and LAVA. Please fix before merging."
26-
echo "::error file=run.sh,line=2::To fix, run: find . -name '*.sh' -o -name 'run.sh' | xargs chmod +x && git add . && git commit -m 'Fix: restore executable bits on scripts' && git push"
33+
echo "::error file=run.sh,line=1::❌ Some shell scripts are missing executable permissions. CI and LAVA may break."
34+
echo "::error file=run.sh,line=2::To fix: find . -name '*.sh' -o -name 'run.sh' | xargs chmod +x && git add . && git commit -m 'Fix: restore executable bits' && git push"
2735
echo ""
28-
echo "The following scripts need 'chmod +x':"
36+
echo "The following files need 'chmod +x':"
2937
echo "$BAD"
30-
# Output a PR annotation for each file
3138
echo "$BAD" | while read -r file; do
32-
echo "::error file=$file,line=1::$file is not executable. Please run: chmod +x $file && git add $file"
39+
echo "::error file=$file,line=1::$file is not executable. Run: chmod +x \"$file\" && git add \"$file\""
3340
done
3441
exit 1
3542
else
36-
echo "✅ All shell scripts have correct executable permissions."
43+
echo "✅ All shell scripts have executable permissions."
3744
fi
3845
39-
- name: Detect accidental executables on non-shell files (optional, warning only)
46+
- name: Warn about non-shell files marked executable (optional)
4047
run: |
41-
# (Advanced/optional) Warn if any non-.sh file has +x (customize as needed)
42-
OTHER_EXEC=$(find . -type f ! -name '*.sh' ! -name 'run.sh' -perm -u=x)
48+
echo "🔍 Checking for accidental executables on non-shell files..."
49+
OTHER_EXEC=$(find . -type f ! \( -name "*.sh" -o -name "run.sh" \) -perm -u=x)
50+
4351
if [ -n "$OTHER_EXEC" ]; then
44-
echo "::warning file=run.sh,line=1::Warning: Non-shell files with executable permissions detected. Review if needed."
52+
echo "::warning file=run.sh,line=1::⚠️ Some non-shell files have executable bits. Review if appropriate."
4553
echo "$OTHER_EXEC"
54+
else
55+
echo "✅ No unexpected executables detected."
4656
fi

Runner/suites/Kernel/Baseport/gpdsp_remoteproc/run.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)