Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: late unstakes #357

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/v2-schedule-unstakes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

last_v2_scoring_epoch_from_dir=$(find scoring-v2 -type d | sort -n | tail -1 | cut -d/ -f2 | cut -d. -f1)
last_v2_scoring_epoch_from_git=$(gh pr list --state open --json headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository == false) | .headRefName' | grep unstakes/ | sort -n | tail -1 | cut -d/ -f2| cut -d. -f1)
last_v2_unstakes_epoch_from_git=$(gh pr list --state merged --json headRefName,isCrossRepository --jq '.[] | select(.isCrossRepository == false) | .headRefName' | grep unstakes/ | sort -n | tail -1 | cut -d/ -f2| cut -d. -f1)

echo "Last V2 scoring epoch (git): $last_v2_scoring_epoch_from_git"
echo "Last V2 scoring epoch (dir): $last_v2_scoring_epoch_from_dir"
Expand All @@ -45,6 +46,12 @@ jobs:
exit 0
fi

if [[ -n $last_v2_unstakes_epoch_from_git ]] && (( last_v2_unstakes_epoch_from_git == current_epoch ))
then
echo "Late unstakes PR was already merged"
exit 0
fi

echo "Triggering the V2 late unstake pipeline..."
gh workflow run v2-prepare-unstakes.yml
env:
Expand Down