diff --git a/.github/workflows/collect_fees_v2.yaml b/.github/workflows/collect_fees_v2.yaml index fec17e98..e1b9bcf4 100644 --- a/.github/workflows/collect_fees_v2.yaml +++ b/.github/workflows/collect_fees_v2.yaml @@ -54,6 +54,7 @@ jobs: python3 main.py --ts_now ${{ steps.date_calc.outputs.end_timestamp }} --ts_in_the_past ${{ steps.date_calc.outputs.start_timestamp }} --fees_file_name fees_${{ steps.date_calc.outputs.date_range_string }}.json --output_file_name incentives_${{ steps.date_calc.outputs.date_range_string }}.csv cd .. cp v2/fee_allocator/allocations/incentives/* fee_allocator/allocations/v2 + cp v2/fee_allocator/allocations/output_for_msig/* fee_allocator/allocations/output_for_msig/v2 cp v2/fee_allocator/payloads/* fee_allocator/tx_builder/transactions/v2 - name: Create PR diff --git a/.github/workflows/trigger_fee_collection.yaml b/.github/workflows/trigger_fee_collection.yaml new file mode 100644 index 00000000..8459a8dd --- /dev/null +++ b/.github/workflows/trigger_fee_collection.yaml @@ -0,0 +1,42 @@ +name: Trigger Fee Collection on Mimic Merge + +on: + push: + branches: + - main + paths: + - 'fee_allocator/fees_collected/*.json' + +jobs: + trigger_fee_collection: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get date from filename + id: get-date + run: | + # Get the path of the changed JSON file + JSON_PATH=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep 'fee_allocator/fees_collected/.*\.json$' | head -n 1) + + if [ -z "$JSON_PATH" ]; then + echo "No JSON file found in recent changes." + exit 1 + fi + + echo "JSON Path: $JSON_PATH" + + # Extract the end date from filename using cut + END_DATE=$(basename "$JSON_PATH" | cut -d'_' -f3 | cut -d'.' -f1) + + echo "end-date=$END_DATE" >> $GITHUB_OUTPUT + + - name: Trigger collect_fees_v2 workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: (V1&V2)Process and run reports for a fee round + inputs: '{"end_day": "${{ steps.get-date.outputs.end-date }}"}' \ No newline at end of file diff --git a/fee_allocator/allocations/output_for_msig/v2/.gitkeep b/fee_allocator/allocations/output_for_msig/v2/.gitkeep new file mode 100644 index 00000000..e69de29b