From 22d33310aa4b58f3387001881182cd1330840bc5 Mon Sep 17 00:00:00 2001 From: PaPerseller Date: Sun, 24 Nov 2024 22:46:08 +0800 Subject: [PATCH] update workflow --- .github/workflows/update-cnip.yml | 38 ++++++++++++++++--------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/update-cnip.yml b/.github/workflows/update-cnip.yml index a3642a08..6c811472 100644 --- a/.github/workflows/update-cnip.yml +++ b/.github/workflows/update-cnip.yml @@ -18,11 +18,10 @@ jobs: - name: Set up Python uses: actions/setup-python@main with: - python-version: '3.12' + python-version: '3.x' check-latest: true - name: Install dependencies - run: | - python -m pip install --upgrade pip + run: pip install netaddr requests - name: generate cn iplist @@ -35,18 +34,21 @@ jobs: python "$script" & done - - name: Commit file - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git add chnroute.txt - git add chnroute-ipv4.txt - git add chnroute-ipv6.txt - git add cn.rsc - git add ipv6.list - git add ./Loon/ruleset/ipv6.list - git add chn.acl - git add v2ray-config_rule.json - git add chnroute.pac - git commit -m "Update `date +%Y-%m-%d`" -a --author="${GITHUB_ACTOR} <${GITHUB_EMAIL}> github-actions[bot] " - git push -f origin master + - name: Get current date + id: date + run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Update ${{ steps.date.outputs.date }}" + file_pattern: | + chnroute.txt + chnroute-ipv4.txt + chnroute-ipv6.txt + cn.rsc + ipv6.list + Loon/ruleset/ipv6.list + chn.acl + v2ray-config_rule.json + chnroute.pac \ No newline at end of file