Auto rebuild anti-AD list #631
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: Auto rebuild anti-AD list | |
on: | |
push: | |
branches: [ adlist-maker ] | |
paths: | |
- '**.php' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: co master | |
uses: actions/[email protected] | |
with: | |
ref: 'master' | |
# Runs a set of commands using the runners shell | |
- name: Run | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action[bot]" | |
git checkout adlist-maker | |
/bin/bash ./scripts/build-list.sh | |
git stash -a | |
git checkout master | |
git checkout stash@{0}^3 -- adblock-for-dnsmasq.conf | |
git checkout stash@{0}^3 -- anti-ad-* | |
git add * -A | |
git commit -am "Auto renew the anti-AD list." | |
git stash clear | |
- name: push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.PERSON_TOKEN }} | |
branch: 'master' | |
- name: sync | |
run: | | |
curl -s -m 30 -X POST "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/workflows/sync-to-dist.yml/dispatches" -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.PERSON_TOKEN }}" -d '{"ref":"master"}' | |