Skip to content

Merge pull request #29 from jlaundry/automated-lsrules-update-1167622… #79

Merge pull request #29 from jlaundry/automated-lsrules-update-1167622…

Merge pull request #29 from jlaundry/automated-lsrules-update-1167622… #79

Workflow file for this run

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
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