Generate pac file #125
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate pac file | |
on: | |
schedule: | |
- cron: 0 0 * * 5 | |
push: | |
branches: | |
- master | |
paths: | |
- rules.txt | |
workflow_dispatch: | |
jobs: | |
generate: | |
name: Generate | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Setup generate tool | |
uses: BSFishy/pip-action@v1 | |
with: | |
packages: genpac | |
- name: Run generate tool | |
run: genpac --format pac --user-rule-from ./rules.txt --pac-proxy "SOCKS5 127.0.0.1:10808" > ./pac.txt | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Commit and push | |
uses: EndBug/[email protected] | |
with: | |
message: "chore: ${{ steps.date.outputs.date }} update pac.txt" | |
add: pac.txt | |
author_name: taozhiyu | |
author_email: [email protected] |