Skip to content

Commit e08acfa

Browse files
committed
test: change weights again but now with allow message
[allow-total-reward-weight-change]
1 parent 826d7ef commit e08acfa

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/pull_request.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ jobs:
3939
- name: Make sure total sum of reward weights doesn't change unless explicitly allowed
4040
run: |
4141
mark='[allow-total-reward-weight-change]'
42-
allow_total_reward_weight_change=$(echo "$COMMIT_MESSAGE" | grep -qF "$mark" && echo "true" || echo "false")
42+
commit_message=$(git show -s --format="%B" "$SOURCE_BRANCH")
43+
allow_total_reward_weight_change=$(echo "$commit_message" | grep -qF "$mark" && echo "true" || echo "false")
4344
exit_code=0
4445
4546
for f in configs/*/approved-sv-id-values.yaml; do
@@ -51,10 +52,10 @@ jobs:
5152
5253
total_weight_diff=$((total_weight_new - total_weight_orig))
5354
54-
if [[ "$allow_total_reward_weight_change" == "true" ]]; then
55-
echo "INFO: Total reward weight diff for $f is: $total_weight_diff. The change is allowed."
56-
elif [[ "$total_weight_diff" == "0" ]]; then
55+
if [[ "$total_weight_diff" == "0" ]]; then
5756
echo "INFO: Total reward weight diff for $f is: $total_weight_diff."
57+
elif [[ "$allow_total_reward_weight_change" == "true" ]]; then
58+
echo "INFO: Total reward weight diff for $f is: $total_weight_diff. The change is allowed."
5859
else
5960
echo "ERROR: Total reward weight diff for $f is: $total_weight_diff. The change is not allowed. Add $mark to the commit message to override." >&2
6061
exit_code=1
@@ -63,5 +64,5 @@ jobs:
6364
6465
exit "$exit_code"
6566
env:
67+
SOURCE_BRANCH: ${{ github.event.pull_request.head.sha }}
6668
TARGET_BRANCH: "origin/${{ github.base_ref }}"
67-
COMMIT_MESSAGE: ${{ github.event.pull_request.head_commit.message }}

configs/DevNet/approved-sv-id-values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ approvedSvIdentities:
4646
rewardWeightBps: 100001
4747
- name: Five-North-1
4848
publicKey: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEVSqn1J3YWij1KBWVNKKOQ8aEPeUc9SFe418mneRdV/PJOX4awAePDrG7A09SYkqP8dyg8ESMw5ltV0dJt5eqlQ==
49-
rewardWeightBps: 0
49+
rewardWeightBps: 1
5050
- name: Proof-Group-1
5151
publicKey: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeSP06KmTXsRJ65JGYwtzKRX9gosW+Gf4IwIquPGT8+XM1ey9La4wdZ+eELNZMPGacQ9fDe2JPFuRJE+fdVsfOQ==
5252
rewardWeightBps: 0

0 commit comments

Comments
 (0)