-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (39 loc) · 1.05 KB
/
update_token.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
name: UpdateToken
on:
schedule:
- cron: '0 0 * * *'
env:
branch: main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ env.branch }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo pip install defichain==3.0.0b3
- name: Execute Script
run: |
cd defichain/transactions/constants
sudo python3 tokens.py
- name: Commit changes
run: |
status=$(git status --porcelain)
if [ -z "$status" ]; then
echo "No changes to the repo, skipping the commit"
exit 0
fi
git config user.name "DefichainPython Bot"
git config user.email "action@github.com"
git add .
git commit -m "Updated token at $(date +'%Y-%m-%d %H:%M:%S')"
- name: Push changes
run: |
git push