-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (37 loc) · 1.28 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: update the list
on:
schedule:
- cron: '0 12 1 * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }} # Use GITHUB_TOKEN for checkout
- name: Checkout curl.wiki Repository
uses: actions/checkout@v3
with:
repository: curl/curl.wiki
path: curl.wiki
token: ${{ secrets.GITHUB_TOKEN }}
- run: ls -la # List files in the root directory for debugging
- id: check
run: |
SOURCE_HASH=$(sha256sum curl.wiki/DNS-over-HTTPS.md | cut -d' ' -f1)
CUR_HASH=$(head -1 doh-list.txt | sed 's/#*//')
if [[ $SOURCE_HASH != $CUR_HASH ]]; then
echo "should_compile=true" >> $GITHUB_OUTPUT
fi
- name: Check for updates and commit if true
if: ${{ steps.check.outputs.should_compile == 'true' }}
run: |
chmod +x ./doh-update.sh # Ensure the script is executable
./doh-update.sh # Run the script
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add doh-list.txt
git commit -m "Updated doh-list.txt" || echo "No changes to commit"
git push