Skip to content

Update Ruleset

Update Ruleset #14

Workflow file for this run

name: Update Ruleset
on:
workflow_dispatch:
# push:
# branches:
# - "Her"
# paths-ignore:
# - "LICENSE"
# - "*.md"
# - "**/*.md"
# - ".*"
# - "node_modules"
schedule:
- cron: 0 */24 * * *
jobs:
Update:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20]
steps:
- name: Fetch repository
uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v5
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: yarn install, update
run: |
yarn install
yarn update-adrules
- name: Merge and Rules and remove duplicates
run: |
awk '/\*/ || /^$/ {next}; !seen[$0]++' RuleSet/AdRules/*.list | grep -v -f RuleSet/AdRules/Bypass.list > RuleSet/AdRule.list
- name: Update Static.list, Download.list and DomesticIP.list
run: |
curl -sL "https://ruleset.skk.moe/List/domainset/cdn.conf" | sed '/#/d; /skk\.moe/d; /^$/d' > RuleSet/Static.list
curl -sL "https://ruleset.skk.moe/List/domainset/download.conf" | sed '/#/d; /skk\.moe/d; /^$/d' > RuleSet/Download.list
curl -sL "https://ruleset.skk.moe/List/ip/china_ip.conf" "https://ruleset.skk.moe/List/ip/china_ip_ipv6.conf" | sed '/#/d; /skk\.moe/d; /^$/d' > RuleSet/DomesticIP.list
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: commit, push
uses: EndBug/add-and-commit@v10
with:
add: "-A"
author_name: 春夏
author_email: git@aapls.com
message: "Update Ruleset"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}