-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (42 loc) · 1.23 KB
/
blank.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
name: Image Workflow
on:
push:
paths:
- 'icon/**' # 监视 icons 文件夹及其子文件夹下的内容
pull_request:
paths:
- 'icon/**' # 监视 icons 文件夹及其子文件夹下的内容
workflow_dispatch:
jobs:
generate_json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Generate JSON
run: |
python .github/scripts/generate_image_json.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: json-artifact
path: ${{ github.workspace }}/Files.icons.json
- name: Push to QuantumultX Repository
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add .
git commit -m "自动更新图标仓库"
git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}