Skip to content

Process and run reports for a fee round #234

Process and run reports for a fee round

Process and run reports for a fee round #234

Workflow file for this run

name: Process and run reports for a fee round
on:
workflow_dispatch:
inputs:
end_day:
description: 'End Date of the last voting period like YYYY-MM-DD. Fees will be calcualted for the 2 week period prior 00:00GMT on this day. It should be on aThursday that during an Aura voting round.'
required: true
jobs:
generate_fees_report:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Collect fees
env:
ETHNODEURL: ${{ secrets.ETHNODEURL }}
ARBNODEURL: ${{ secrets.ARBNODEURL }}
POLYNODEURL: ${{ secrets.POLYNODEURL }}
BASENODEURL: ${{ secrets.BASENODEURL }}
GNOSISNODEURL: ${{ secrets.GNOSISNODEURL }}
GNOSIS_API_KEY: ${{ secrets.GNOSIS_API_KEY }}
AVALANCHENODEURL: ${{ secrets.AVALANCHENODEURL }}
POLYZKEVMNODEURL: ${{ secrets.POLYZKEVMNODEURL }}
run: |
pwd
end_day=${{ github.event.inputs.end_day }}
start_day=$(date -d "$end_day -14 days" +%Y-%m-%d)
date_range_string="${start_day}_${end_day}"
echo $date_range_string
start_timestamp=$(date -d "$start_day 00:00:00" +"%s")
end_timestamp=$((start_timestamp + 60*60*24*14)) # 2 weeks later
pip3 install -r requirements.txt
python3 main.py --ts_now $end_timestamp --ts_in_the_past $start_timestamp --fees_file_name fees_${date_range_string}.json --output_file_name incentives_${date_range_string}.csv
python3 generate_merged_allocation_csv.py
- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: "task: new fees report ending ${{ github.events.inputs.end_day }}"
title: "Biweekly Fee Report ending ${{ github.events.inputs.end_day }}"
branch: gha-biweekly-fees
branch-suffix: timestamp
delete-branch: true
labels: "Biweekly-Report"