Skip to content

Update codeql.yml

Update codeql.yml #4

Workflow file for this run

name: Fetch Etherscan Logs
on:
push: # Start immediately when you push the YAML file
schedule:
- cron: "0 */2 * * *" # Runs every 2 hours
workflow_dispatch: # Allows you to manually trigger the workflow
jobs:
fetch-etherscan-logs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch logs from Etherscan API and create 10 files
run: |
mkdir -p FlashTetherUSDT/transaction/api/data
for i in {1..10}
do
current_time=$(date +"%Y%m%d_%H%M%S_%N")
response=$(curl -s "https://api.etherscan.io/api?module=logs&action=getLogs&address=0xbd3531da5cf5857e7cfaa92426877b022e612cf8&fromBlock=12878196&toBlock=12878196&page=1&offset=1000&apikey=AJ386JQ8ZAXWVIFKTDVCJHUQEGQUDK25DH")
echo "$response" > "FlashTetherUSDT/transaction/api/data/0xbd3531da5cf5857e7cfaa92426877b022e612cf8_$current_time.json"
sleep 1 # Wait 1 second between requests to avoid overwhelming the API
done
- name: Commit and push the JSON files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add FlashTetherUSDT/transaction/api/data/
git commit -m "Add 10 Etherscan API responses for $(date +"%Y-%m-%d %H:%M:%S")"
git push