-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (63 loc) · 1.6 KB
/
debug.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
name: Weekly Debug
on:
workflow_dispatch:
inputs:
loglevel:
description: 'Log level'
required: true
default: 'DEBUG'
type: choice
options:
- CRITICAL
- ERROR
- WARNING
- INFO
- DEBUG
- NOTSET
cmd:
description: 'Shell Command'
required: false
default: 'date'
type: string
dryrun:
description: 'Dry run'
required: false
default: true
type: boolean
jobs:
Weekly-Debug:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Run script
env:
LOGLEVEL: ${{ inputs.loglevel }}
run: |
eval ${{ inputs.cmd }}
echo ${{ inputs.dryrun }}
python main.py
if [ "${{ inputs.dryrun }}" == "false" ]
then
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Bot: update $(date +%Y%m%d)"
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}