-
Notifications
You must be signed in to change notification settings - Fork 722
42 lines (38 loc) · 1.29 KB
/
auto-rebuild.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
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"}'