-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.54 KB
/
little_snitch.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
name: "Update Little Snitch rules"
on:
push:
branches:
- main
schedule:
- cron: '42 1 * * 2'
workflow_dispatch:
jobs:
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- run: pip install -r macos/little_snitch/requirements.txt
- name: Create PR for Little Snitch rules updates
id: push_image_info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global user.email [email protected]
git config --global user.name github-actions
git config pull.rebase false
branch=automated-lsrules-update-$GITHUB_RUN_ID
git checkout -b $branch
cd macos/little_snitch
python3 update_crl.py
python3 update_icloud.py
python3 update_microsoft.py
python3 update_tailscale.py
cd ../..
message='Automated lsrules update'
# Add / update and commit
git add macos/little_snitch/rules/*.lsrules
git commit -m "$message [skip ci]" || export NO_UPDATES=true
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
gh pr create --title "$message" --body "$message"
fi