This repository was archived by the owner on Jun 17, 2025. It is now read-only.
Merge pull request #357 from BalancerMaxis/gha-mimic-fees-1741857829 #4
This file contains hidden or 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: 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 }}"}' |