-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (42 loc) · 1.3 KB
/
generate_directory_json.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
name: Generate Directory JSON
on:
push:
branches: [ main ]
paths:
- "plugin_market/**"
pull_request:
branches: [ main ]
paths:
- "plugin_market/**"
workflow_dispatch: {}
jobs:
generate_json:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12' # 你想要使用的 Python 版本
- name: Generate JSON
run: python plugin_market/get_directory.py
- name: Submit Changes
if: ${{ github.event_name == 'pull_request' }} # 仅在 Pull Request 事件中运行
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: '[AUTO] Generate Directory JSON'
add: 'plugin_market/directory.json'
branch: ${{ github.head_ref }} # 使用 PR 的源分支作为目标分支
- name: Submit Changes
uses: EndBug/add-and-commit@v9
if: ${{ github.event_name == 'push' }}
with:
default_author: github_actions
message: '[AUTO] Generate Directory JSON'
add: 'plugin_market/directory.json'