wrong direction #93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |