forked from rizalmart/barker-build-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.52 KB
/
fix-script-permission.yml
File metadata and controls
45 lines (36 loc) · 1.52 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
name: Make Scripts Executable
on:
push:
branches: [ master ]
workflow_dispatch: # Allows you to run this manually
jobs:
chmod-scripts:
runs-on: ubuntu-latest
permissions:
contents: write # Required to push changes back
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Change permissions
run: |
# Replace 'scripts' with your actual folder name
# This finds all .sh files in the folder and makes them executable
find puppy-rootfs-template/usr/lib/puppy/bin -type f -name "*" | xargs -i chmod +x '{}'
find puppy-rootfs-template/usr/lib/puppy/sbin -type f -name "*" | xargs -i chmod +x '{}'
find puppy-source-builds -type f -name "*" | xargs -i chmod +x '{}'
find ./ -type f -name "*.sh" | xargs -i chmod +x '{}'
- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add puppy-rootfs-template/usr/lib/puppy/bin/*
git add puppy-rootfs-template/usr/lib/puppy/sbin/*
git add puppy-source-builds/*
git add ./*.sh
# Only commit if there are actually changes to avoid workflow errors
if git diff --staged --quiet; then
echo "No permission changes detected."
else
git commit -m "chore: make scripts executable"
git push
fi