-
Notifications
You must be signed in to change notification settings - Fork 150
84 lines (73 loc) · 2.08 KB
/
update_status.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Update Status
run-name: Update Status
on:
workflow_dispatch:
inputs:
no_skip_edu:
description: 'Do not skip edu domains'
required: true
type: 'boolean'
default: false
count_only:
description: 'Only count the number of domains, do not verify'
required: true
type: 'boolean'
default: false
schedule:
- cron: '30 3/4 * * *'
push:
branches:
- main
paths:
- 'README.md'
- '.github/workflows/update_status.yml'
- 'verify-url.py'
- 'new/**'
- 'whitelist.json'
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
update_status:
name: Update Status
runs-on: ubuntu-latest
if: ${{ github.repository == 'cokice/List-of-genshin-University' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install dnspython requests pypinyin
- name: Prepare Proxy
run: |
echo -e "${{ secrets.PROXY }}" >> proxies.txt
- name: Update status
run: python3 verify-url.py
id: update_status
env:
NO_SKIP_EDU: ${{ github.event.inputs.no_skip_edu == true && '1' || '0' }}
COUNT_ONLY: ${{ github.event.inputs.count_only == true && '1' || '0' }}
- name: Revert Proxy
run: |
git checkout proxies.txt
- name: Commit and push
uses: actions4git/add-commit-push@v1
with:
commit-message: ${{ steps.update_status.outputs.commit_message }}
continue-on-error: true
push_to_website:
name: Push to website
uses: ./.github/workflows/main.yml
needs: update_status
if: ${{ github.repository == 'cokice/List-of-genshin-University' }}
secrets:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}