Skip to content

Commit 16d538c

Browse files
committed
chore: Add dry-run script
1 parent 5f16785 commit 16d538c

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/upgrade-facets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
elif [ "${{ inputs.network }}" == "arbitrum" ]; then
6767
export ARBITRUM_FORK=true
6868
fi
69-
npx hardhat run scripts/upgrades/${{ env.UPGRADE_SCRIPT }} --network hardhat
69+
UPGRADE_SCRIPT=${{ env.UPGRADE_SCRIPT }} bash ./scripts/upgrades/dry-run.sh
7070
7171
- name: Execute upgrade on live network
7272
if: inputs.dry-run == false

scripts/upgrades/dry-run.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Usage:
5+
# ARBITRUM_SEPOLIA_FORK=true UPGRADE_SCRIPT=<script_name> bash ./scripts/upgrades/dry-run.sh
6+
# ARBITRUM_FORK=true UPGRADE_SCRIPT=<script_name> bash ./scripts/upgrades/dry-run.sh
7+
8+
9+
DEPLOYMENTS_FOLDER=''
10+
if [ "${ARBITRUM_SEPOLIA_FORK}" == "true" ]; then
11+
DEPLOYMENTS_FOLDER=arbitrumSepolia
12+
elif [ "${ARBITRUM_FORK}" == "true" ]; then
13+
DEPLOYMENTS_FOLDER=arbitrum
14+
fi
15+
16+
rm -rf deployments/hardhat
17+
cp -r deployments/${DEPLOYMENTS_FOLDER} deployments/hardhat
18+
cp .gitignore .gitignore.bak
19+
sed -i '/deployments\/hardhat/d' .gitignore
20+
git add deployments/hardhat
21+
npx hardhat run scripts/upgrades/${UPGRADE_SCRIPT} --network hardhat
22+
# Print the changes made during the dry run
23+
git --no-pager diff --name-status
24+
mv .gitignore.bak .gitignore

0 commit comments

Comments
 (0)