diff --git a/.github/workflows/v2-prepare-unstakes.yml b/.github/workflows/v2-prepare-unstakes.yml index a53164a..e7cb924 100644 --- a/.github/workflows/v2-prepare-unstakes.yml +++ b/.github/workflows/v2-prepare-unstakes.yml @@ -94,19 +94,25 @@ jobs: validator_json=$(jq -n --arg account "$account" --argjson hints "$hints_merged" '{vote_account: $account, hints: $hints}') jq --argjson validator "$validator_json" '.unstake_hints += [$validator]' "$output" > "$temp" && mv "$temp" "$output" done + total_marinade_stake=$(jq '[.unstake_hints[].marinade_stake | tonumber] | add' merged.json) + validators_count=$(jq '.unstake_hints | length' merged.json) + echo "total_marinade_stake=$total_marinade_stake" >> $GITHUB_ENV + echo "validators_count=$validators_count" >> $GITHUB_ENV mv merged.json "${{ env.unstake_hints_json }}" - name: Make a Pull Request run: | scoring_id="${{ env.scoring_id }}" scoring_branch="ds-unstakes/$scoring_id" + total_marinade_stake="${{ env.total_marinade_stake }}" + validators_count="${{ env.validators_count }}" git config --global user.name 'Autonomous Scoring Pipeline' git config --global user.email 'bot@noreply.marinade.finance' git checkout -b "$scoring_branch" git add scoring-v2 ! [ -z "$(git status --porcelain)" ] && git commit -m "emergency unstakes for scoring run $scoring_id" && git push -u origin "$scoring_branch" || echo "No changes to be committed" - - pr_url=$(gh pr create -B scoring-v2 -H "$scoring_branch" --title "Publish V2 Emergency Unstakes ($scoring_id)") + pr_body="Total Marinade stake: $total_marinade_stake\nNumber of validators: $validators_count\n\nEmergency unstakes for scoring run $scoring_id." + pr_url=$(gh pr create -B scoring-v2 -H "$scoring_branch" --title "Publish V2 Emergency Unstakes ($scoring_id)" --body "$pr_body") echo "pr_url=$pr_url" >> $GITHUB_ENV env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file