-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.35 KB
/
main.yaml
File metadata and controls
53 lines (43 loc) · 1.35 KB
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
name: run main.py
permissions:
contents: write
on:
# 手动触发事件
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
schedule:
- cron: '10 11 * * *' # At 11:00 Everday
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: checkout repo content
uses: actions/checkout@v4 # checkout the repository content to github runner
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.11.9' # install the python version needed
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: execute py script # run main.py
run: python main.py
- name: commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
DATE=$(date +%Y-%m-%d)
git diff-index --quiet HEAD || (git commit -a -m "Updated logs on $DATE" --allow-empty)
- name: push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master