push其他文件时也自动生成gfw.pac
This commit is contained in:
39
.github/workflows/auto-generate-pac.yml
vendored
Normal file
39
.github/workflows/auto-generate-pac.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Auto Generate PAC File
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '10 0 * * 4'
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'LICENSE'
|
||||
- 'gfw.pac'
|
||||
- '.gitignore'
|
||||
- '.github/**'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update-gfw-pac:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download the latest cn.txt
|
||||
run: curl -L https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/cn.txt -o cidrs-cn.txt
|
||||
|
||||
- name: Run gfw-pac.py script
|
||||
run: ./gfw-pac.py -f gfw.pac -p "PROXY 127.0.0.1:3128" --proxy-domains=proxy-domains.txt --direct-domains=direct-domains.txt --localtld-domains=local-tlds.txt --ip-file=cidrs-cn.txt
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add -A
|
||||
git commit -a -m "自动生成 gfw.pac"
|
||||
git push
|
||||
|
||||
- name: Trigger Auto-Release
|
||||
uses: benc-uk/workflow-dispatch@v1
|
||||
with:
|
||||
workflow: Auto Generate Release
|
||||
Reference in New Issue
Block a user