Skip to content

Create Add Rewards Payload #33

Create Add Rewards Payload

Create Add Rewards Payload #33

name: Create Add Rewards Payload
on:
workflow_dispatch:
inputs:
token:
description: "Reward Token"
required: true
gauge:
description: "Gauge to reward"
required: true
distributor:
description: "Distributor who can load incentives (address or unique bal_addresses string)"
required: false
multisig:
description: "Multisig that should execute this transaction((address or unique bal_addresses string)"
required: true
chain_name:
description: "Chain Name. Exists in bal_addresses: One of [base, gnosis, zkevm, avalanche, mainnet, arbitrum, optimism, polygon, sepolia, mode, fraxtal]"
required: true
jobs:
add-rewards:
runs-on: ubuntu-latest
outputs:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
pull-request-branch: ${{ steps.generate-branch-name.outputs.branch }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install git+https://github.com/BalancerMaxis/[email protected]
- name: Run script
run: |
python action-scripts/tx_build_add_reward_token.py
env:
TOKEN: ${{ github.event.inputs.token }}
GAUGE: ${{ github.event.inputs.gauge }}
DISTRIBUTOR: ${{ github.event.inputs.distributor }}
MULTISIG: ${{ github.event.inputs.multisig }}
CHAIN_NAME: ${{ github.event.inputs.chain_name }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
- name: Prepare PR title and body
run: |
echo "PR_TITLE=Automatically generated add_rewards payload (direct incentives) - $TOKEN - $GAUGE" >> $GITHUB_ENV
echo "PR_BODY=This pull request was automatically generated by the GitHub Actions workflow. Here are the details of the event that triggered this workflow: - Reward Token: $TOKEN - Gauge: $GAUGE - Distributor: $DISTRIBUTOR - Multisig: $MULTISIG - Chain Name: $CHAIN_NAME" >> $GITHUB_ENV
env:
TOKEN: ${{ github.event.inputs.token }}
GAUGE: ${{ github.event.inputs.gauge }}
DISTRIBUTOR: ${{ github.event.inputs.distributor }}
MULTISIG: ${{ github.event.inputs.multisig }}
CHAIN_NAME: ${{ github.event.inputs.chain_name }}
- name: Generate branch name
id: generate-branch-name
run: |
echo "::set-output name=branch::${{ github.job }}-$(date +'%Y%m%d%H%M%S')"
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
title: ${{ env.PR_TITLE }}
body: ${{ env.PR_BODY }}
branch: ${{ steps.generate-branch-name.outputs.branch }}
labels: "Gauge Add Reward"
delete-branch: true
run_reports:
needs: add-rewards
secrets: inherit
uses: "BalancerMaxis/multisig-ops/.github/workflows/run_reports_reusable.yaml@main"
with:
pr_number: ${{ needs.add-rewards.outputs.pull-request-number }}
checkout_ref: ${{ needs.add-rewards.outputs.pull-request-branch }}