Skip to content

updates for ROLE_ID_OPERATIONS_COORDINATOR #3

updates for ROLE_ID_OPERATIONS_COORDINATOR

updates for ROLE_ID_OPERATIONS_COORDINATOR #3

name: Fetch Etherscan Data and Update Documentation
# TODO: Uncomment the following line to enable the workflow scheduling
# TODO: Update the etherscan script for appropriate data fetching
# on:
# schedule:
# # Runs at 05:00 UTC every day
# - cron: '0 5 * * *'
jobs:
fetch_and_update:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Python dependencies
run: |
pip install requests
- name: Fetch data from Etherscan
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
# ETH_ADDRESS: ${{ secrets.ETH_ADDRESS }}
run: |
python ./scripts/fetch_etherscan_data.py $ETHERSCAN_API_KEY logs/transactions.json
- name: Convert data to Markdown
run: |
python ./scripts/convert_to_markdown.py logs/transactions.json logs/transactions.md
- name: Create new branch for update
run: |
DATE=`date +'%Y-%m-%d-%H-%M'`
git checkout -b etherscan-update-$DATE
git config user.name 'github-actions'
git config user.email '[email protected]'
- name: Add changes to Git
run: |
git add logs/transactions.md
git commit -m "Update Etherscan data on ${{ github.run_id }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: etherscan-update-${{ github.run_id }}
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: "etherscan-update-$DATE"
destination_branch: "main"
pr_title: "Automated Etherscan Data Update on $DATE"
pr_body: "This is an automated pull request to update from branch etherscan-update-$DATE"