-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 1.86 KB
/
add.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
name: Add new custom code
on:
workflow_dispatch:
inputs:
code_type:
description: 'code type'
required: true
type: choice
options: ['main', 'over']
code:
description: 'gift code'
required: true
expire:
description: 'expire date, format: 2023-6-10 or 2023-06-10:12:00:00'
required: true
rewards:
description: 'rewards, format: 星琼:60 信用点:1000'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
# 此步骤使用 GitHub 的 https://github.com/actions/checkout
- name: checkout actions
uses: actions/checkout@v3
# 设置python环境
# 此步骤使用 GitHub 的 https://github.com/actions/setup-python
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
# 安装依赖
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# 添加 code
- name: Update over code
run: |
python add.py ${{ github.event.inputs.code_type }} ${{ github.event.inputs.code }} ${{ github.event.inputs.expire }} ${{ github.event.inputs.rewards }}
python main.py
# Auto commit
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
message: ':sparkles: Add new code'
add: |
'data/custom.json'
# Auto commit
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
push: 'origin main'
message: ':sparkles: Update Codes'
add: |
'data'