diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a671b73d8..a24e02160 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ ## Add new chain -Template to provide information about the new chain. Only add extra information in the bottom section. Ensure that the contracts are deployed on the chain, if not deploy with [safe-contracts](https://github.com/safe-global/safe-contracts). This entire paragraph can be deleted. +> Template to provide information about the new chain. Only add extra information in the bottom section. Ensure that the contracts are deployed on the chain, if not deploy with [safe-contracts](https://github.com/safe-global/safe-contracts). This entire paragraph can be deleted. Please fill the following form: diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 52c45cfb9..68fddb7cf 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -27,19 +27,9 @@ jobs: id: review-check-result run: | script_result=$(bash bin/github-review.sh ${PR_NUMBER} | tail -1) - echo "script_result=$script_result" >> $GITHUB_OUTPUT; - - review-result: - runs-on: ubuntu-latest - needs: [review-check] - steps: - - uses: actions/checkout@v4 - - name: Post Success Comment to the PR - if: needs.review-check.outputs.review-result == 'Network addresses & Code hashes are correct' - run: | - gh pr comment "$PR_NUMBER" --repo "$REPO" --body "✅ Success: Network addresses & Code hashes are correct" - - name: Post Failure Comment to the PR - if: needs.review-check.outputs.review-result != 'Network addresses & Code hashes are correct' - run: | - gh pr comment "$PR_NUMBER" --repo "$REPO" --body "⛔️ Error: Check the 'review-check::Check PR' log for more details" - exit 1 + if [ "$script_result" != "Network addresses & Code hashes are correct" ]; then + echo "⛔️ Error: $script_result" + exit 1 + else + echo "✅ Success: $script_result" + fi diff --git a/bin/github-review.sh b/bin/github-review.sh index 753fe1935..77df37ebc 100755 --- a/bin/github-review.sh +++ b/bin/github-review.sh @@ -155,9 +155,7 @@ for file in "${versionFiles[@]}"; do for deploymentType in "${deploymentTypes[@]}"; do defaultAddress=$(jq -r --arg t "$deploymentType" '.addresses[$t]' "$file") defaultCodeHash=$(jq -r --arg t "$deploymentType" '.codeHash[$t]' "$file") - DEFAULTADDRESS=$defaultAddress RPCURL=$rpc npm run codehash - networkCodeHash=$(cat codehash.txt) - rm codehash.txt + networkCodeHash=$(cast code $defaultAddress --rpc-url $rpc | tr -d '\n' | cast keccak) if [[ $defaultCodeHash != $networkCodeHash ]]; then echo "ERROR: "$file" ("$defaultAddress") code hash ("$defaultCodeHash") is not the same as the one created for the chain id ("$networkCodeHash")" 1>&2 exit 1 diff --git a/package.json b/package.json index a2979239d..047861c45 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ ], "scripts": { "build": "rimraf dist && tsc", - "codehash": "node scripts/codehash.js", "lint": "npm run lint:ts && npm run lint:json", "lint:ts": "eslint --max-warnings 0 src/", "lint:json": "prettier -c src/assets/*/*.json", diff --git a/scripts/codehash.js b/scripts/codehash.js deleted file mode 100644 index a4a57baac..000000000 --- a/scripts/codehash.js +++ /dev/null @@ -1,6 +0,0 @@ -const { exec } = require('child_process'); - -const defaultAddress = process.env.DEFAULTADDRESS; -const rpc = process.env.RPCURL; - -exec('echo $(cast keccak $(cast code ' + defaultAddress + ' --rpc-url ' + rpc + ') > codehash.txt)');