anti-AD/.github/workflows/auto-rebuild.yml

43 lines
1.3 KiB
YAML
Raw Normal View History

2021-05-28 21:03:53 +08:00
name: Auto rebuild anti-AD list
on:
push:
2021-05-29 08:30:00 +08:00
branches: [ adlist-maker ]
2021-05-29 09:26:34 +08:00
paths:
- '**.php'
2021-05-28 21:03:53 +08:00
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
2024-02-03 14:54:58 +08:00
- uses: actions/checkout@v4.1.1
2021-05-29 08:32:45 +08:00
- name: co master
2024-02-03 14:54:58 +08:00
uses: actions/checkout@v4.1.1
2021-05-29 00:46:49 +08:00
with:
2021-05-29 08:32:45 +08:00
ref: 'master'
2021-05-28 21:03:53 +08:00
# Runs a set of commands using the runners shell
2021-05-29 00:31:36 +08:00
- name: Run
2021-05-28 21:03:53 +08:00
run: |
2021-05-29 00:53:15 +08:00
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action[bot]"
2021-05-29 08:30:00 +08:00
git checkout adlist-maker
2021-05-29 00:37:33 +08:00
/bin/bash ./scripts/build-list.sh
2023-03-29 20:49:12 +08:00
git stash -a
2021-05-29 08:32:45 +08:00
git checkout master
2021-05-29 00:31:36 +08:00
git checkout stash@{0}^3 -- adblock-for-dnsmasq.conf
git checkout stash@{0}^3 -- anti-ad-*
2023-04-23 20:00:22 +08:00
git add * -A
2021-05-29 00:31:36 +08:00
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 }}
2021-05-29 08:32:45 +08:00
branch: 'master'
2021-05-29 11:08:40 +08:00
- 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"}'
2021-05-29 00:31:36 +08:00