Build Filters AGH #444
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: Build Filters AGH | |
on: | |
schedule: [{cron: "0 */6 * * *"}] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: pip | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt | |
- name: Set Git user identity | |
run: | | |
git config --global user.name "${{ secrets.GIT_USER_NAME }}" | |
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Execute script AGH_Whitelist.py | |
run: | | |
cd Scripts/ | |
chmod +x AGH_Whitelist.py | |
python3 ./AGH_Whitelist.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Execute script AGH_filters.py | |
run: | | |
cd Scripts/ | |
chmod +x AGH_filters.py | |
python3 ./AGH_filters.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Execute script AGH_filters+.py | |
run: | | |
cd Scripts/ | |
chmod +x AGH_filters+.py | |
python3 ./AGH_filters+.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Execute script dnsmasq_filters+.py | |
run: | | |
cd Scripts/ | |
chmod +x dnsmasq_filters+.py | |
python3 ./dnsmasq_filters+.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Apply changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git add Filters/AGH_Host.txt Filters/whitelist/whitelist.txt Filters/AGH_Host+.txt Filters/dnsmasq.txt | |
# Check for changes in the staging area before attempting to commit. | |
if git diff --cached --quiet; then | |
echo "There are no changes to the selected files, nothing to do." | |
else | |
git commit -m "Updating files from GitHub Actions" | |
git push origin main | |
fi |