UpdateToken #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |