-
-
Notifications
You must be signed in to change notification settings - Fork 56
62 lines (55 loc) · 2.59 KB
/
copy_uad_file.yml
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
54
55
56
57
58
59
60
61
62
name: Copy UAD File
on:
workflow_dispatch: # Allow manual triggering
## Run the file every day at 00:00 UTC
schedule:
- cron: "0 0 * * *"
jobs:
copy_file:
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
repository: Universal-Debloater-Alliance/universal-android-debloater-next-generation
path: source_repo
### Copy file to HOME
- name: Copy file to HOME
run: |
if [ -f source_repo/resources/assets/uad_lists.json ]; then
mkdir -p $HOME/.uad_lists || { echo "Failed to create directory"; exit 1; }
if [ -f $HOME/.uad_lists/uad_lists.json ]; then
echo "Warning: File already exists and will be overwritten"
fi
cp source_repo/resources/assets/uad_lists.json $HOME/.uad_lists/ || { echo "Failed to copy file"; exit 1; }
else
echo "Source file does not exist"
exit 1
fi
### Checkout current repository
- name: Checkout current repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: inure
### File should be copied to inure/app/src/github/resources/uad_lists.json
- name: Copy file
run: |
if [ -f $HOME/.uad_lists/uad_lists.json ]; then
mkdir -p inure/app/src/github/resources || { echo "Failed to create directory"; exit 1; }
if [ -f inure/app/src/github/resources/uad_lists.json ]; then
echo "Warning: File already exists and will be overwritten"
fi
cp $HOME/.uad_lists/uad_lists.json inure/app/src/github/resources/ || { echo "Failed to copy file"; exit 1; }
else
echo "Source file does not exist"
exit 1
fi
- name: Commit changes
run: |
cd inure
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "Update UAD Lists file from source repository" || true
git push origin master