This commit is contained in:
ᡠᠵᡠᡳ ᡠᠵᡠ ᠮᠠᠨᡩ᠋ᠠᠨ 2025-03-24 16:39:51 +08:00 committed by UjuiUjuMandan
parent 06377ff496
commit 4e98d05cba

View File

@ -4,6 +4,7 @@ on:
push: push:
paths: paths:
- 'list.txt' - 'list.txt'
workflow_dispatch:
jobs: jobs:
convert-and-push: convert-and-push:
@ -13,12 +14,13 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
submodules: 'true'
fetch-depth: '0' fetch-depth: '0'
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y date file git openssl perl sudo apt-get install -y file git openssl perl
- name: Sanity check. - name: Sanity check.
run: | run: |
@ -26,22 +28,11 @@ jobs:
command -v $cmd >/dev/null 2>&1 || { echo "Error: You must have $cmd command installed!"; exit 1; } command -v $cmd >/dev/null 2>&1 || { echo "Error: You must have $cmd command installed!"; exit 1; }
done done
- name: modified by others, commit to local git repository
run: |
git diff --quiet HEAD^ HEAD list.txt || echo "modified=true" >> $GITHUB_ENV
continue-on-error: true
- name: exit if no changes
if: env.modified != 'true'
run: |
echo "Info: list.txt not modified."
exit 0
- name: update date and checksum - name: update date and checksum
run: | run: |
cp apollyon/* ./ cp apollyon/* ./
perl addChecksum.pl list.txt || { echo "Error: Failed to update checksum"; exit 1; } perl addChecksum.pl list.txt || { echo "Error: Failed to update checksum"; exit 1; }
if [ "$(file -b list.txt)" != "ASCII text" ]; then if [ "$(file -b list.txt | grep -o "ASCII text")" != "ASCII text" ]; then
echo "Error: list.txt invalid, please make sure:" echo "Error: list.txt invalid, please make sure:"
echo "1. there is no non-ASCII characters;" echo "1. there is no non-ASCII characters;"
echo "2. configure your text editor to use unix style line break." echo "2. configure your text editor to use unix style line break."
@ -58,3 +49,4 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v4 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
commit_message: gfwlist edited ${{ env.DATE }} commit_message: gfwlist edited ${{ env.DATE }}
file_pattern: 'gfwlist.txt'