diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index c16ed4d..e7fa94f 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -1,16 +1,20 @@ name: Auto Generate Release on: - workflow_dispatch: push: paths: - - 'gfw.pac' # 替换为你要监控的文件路径 + - 'gfw.pac' + workflow_dispatch: jobs: generate-release: runs-on: ubuntu-latest steps: + + - env: + GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + - name: Checkout repository uses: actions/checkout@v3 @@ -42,7 +46,7 @@ jobs: body: "Automatically generated release for pac file update" draft: false prerelease: false - files: gfw.pac # 替换为你要上传的文件路径 + files: gfw.pac - name: Verify Release run: | diff --git a/.github/workflows/auto-update-gfw-pac.yml b/.github/workflows/auto-update-gfw-pac.yml index 40ebba6..e784da3 100644 --- a/.github/workflows/auto-update-gfw-pac.yml +++ b/.github/workflows/auto-update-gfw-pac.yml @@ -2,23 +2,26 @@ name: GFW PAC Update on: schedule: - - cron: '0 0 */14 * *' + - cron: '0 0 */7 * *' workflow_dispatch: jobs: update-gfw-pac: runs-on: ubuntu-latest steps: + - env: + GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + - name: Checkout repository uses: actions/checkout@v4 - - name: Download delegated-apnic-latest + - name: Download cn.txt run: curl https://raw.githubusercontent.com/Loyalsoldier/geoip/refs/heads/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 gfw.pac + - name: Commit changes run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" @@ -28,5 +31,5 @@ jobs: - name: Push changes uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.PUSH_TOKEN }} + github_token: ${{ secrets.PERSONAL_TOKEN }} branch: master diff --git a/README.md b/README.md index 3d8c800..f904612 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 科学上网 PAC 文件以及生成器。通过自定义域名和 CNIP 地址生成 PAC(Proxy auto-config) 文件。对存在于自定义域名和解析出的IP不是CNIP的域名使用代理,支持IPv6。 -**此仓库每 14 天自动通过 GitHub Action 从 `Loyalsoldier/geoip` 获取国内地址段并更新 `gfw.pac` 文件** +**此仓库每 7 天自动通过 GitHub Action 从 `Loyalsoldier/geoip` 获取国内地址段并更新 `gfw.pac` 文件** ## 特性 * 开箱即用,直接可用的 `gfw.pac` 包含了常用的直连域名和代理域名以及国内IPv4/IPv6地址段