Skip to content

Commit

Permalink
fix: unstakes pr creation
Browse files Browse the repository at this point in the history
  • Loading branch information
butonium committed Mar 28, 2024
1 parent 61d591f commit 7d7a084
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/v2-prepare-unstakes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 '[email protected]'
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 }}

0 comments on commit 7d7a084

Please sign in to comment.