-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.31 KB
/
actions.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
name: Weekly Bot
on:
schedule:
- cron: '30 21 * * *'
jobs:
Weekly-Bot-Actions:
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: 'DEBUG'
run: python main.py
- name: Check for changes
run: |
if git diff --exit-code; then
echo "changed=false" >> "$GITHUB_ENV"
else
echo "changed=true" >> "$GITHUB_ENV"
fi
- name: Commit files
if: ${{ env.changed == 'true' }}
run: |
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)"
- name: Push changes
if: ${{ env.changed == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}