Skip to content

Commit a36165e

Browse files
committed
refactor: Enhance propose-to-safe-tx job to inherit environment secrets for improved security
1 parent 4902dc3 commit a36165e

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

.github/workflows/bridge-pause-safe.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
transaction-data: ${{ steps.prepare.outputs.transaction-data }}
3737
safe-address: ${{ steps.prepare.outputs.safe-address }}
3838
bridge-address: ${{ steps.prepare.outputs.bridge-address }}
39+
# Note: We'll pass secrets through the next job
3940

4041
steps:
4142
- name: Checkout repository
@@ -61,22 +62,18 @@ jobs:
6162
# Determine the function selector and name based on operation
6263
case "${{ inputs.operation }}" in
6364
"pause-bridge")
64-
# pause() function selector
6565
TRANSACTION_DATA=$(cast calldata "pause()")
6666
FUNCTION_NAME="pause()"
6767
;;
6868
"unpause-bridge")
69-
# unpause() function selector
7069
TRANSACTION_DATA=$(cast calldata "unpause()")
7170
FUNCTION_NAME="unpause()"
7271
;;
7372
"pause-outbound")
74-
# pauseOutboundTransfers() function selector
7573
TRANSACTION_DATA=$(cast calldata "pauseOutboundTransfers()")
7674
FUNCTION_NAME="pauseOutboundTransfers()"
7775
;;
7876
"unpause-outbound")
79-
# unpauseOutboundTransfers() function selector
8077
TRANSACTION_DATA=$(cast calldata "unpauseOutboundTransfers()")
8178
FUNCTION_NAME="unpauseOutboundTransfers()"
8279
;;
@@ -85,7 +82,7 @@ jobs:
8582
echo "transaction-data=$TRANSACTION_DATA" >> $GITHUB_OUTPUT
8683
echo "safe-address=${{ vars.SAFE_ADDRESS }}" >> $GITHUB_OUTPUT
8784
88-
# Display transaction details for dry-run or verification
85+
# Display transaction details
8986
echo "=========================================="
9087
echo "Transaction Details"
9188
echo "=========================================="
@@ -96,28 +93,30 @@ jobs:
9693
echo " • Safe Address: ${{ vars.SAFE_ADDRESS }}"
9794
echo " • Dry Run: ${{ inputs.dry-run }}"
9895
echo ""
99-
echo "────────────────────────────────────────────────────────────────────────────────"
100-
echo ""
10196
echo "Transaction Details:"
10297
echo " • Target: $BRIDGE_ADDRESS"
10398
echo " • Value: 0 ETH"
10499
echo " • Data: $TRANSACTION_DATA"
105100
echo ""
106-
echo "────────────────────────────────────────────────────────────────────────────────"
107-
echo ""
108101
109102
if [ "${{ inputs.dry-run }}" == "true" ]; then
110103
echo "✅ DRY RUN MODE: Transaction prepared successfully"
111-
echo "ℹ️ This transaction would be proposed to Safe multisig"
112-
echo "ℹ️ Re-run with dry-run=false to actually propose to Safe"
113104
fi
114105
106+
# ✅ NEW: Wrapper job that bridges the environment secrets to the reusable workflow
115107
propose-to-safe-tx:
116108
needs: prepare-transaction-calldata
117-
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/propose-safe-multisig-tx.yml@fix/multisig-rpc-secrets
118-
secrets: inherit
119-
with:
120-
safe-address: ${{ needs.prepare-transaction-calldata.outputs.safe-address }}
121-
transaction-to: ${{ needs.prepare-transaction-calldata.outputs.bridge-address }}
122-
transaction-data: ${{ needs.prepare-transaction-calldata.outputs.transaction-data }}
123-
dry-run: ${{ inputs.dry-run }}
109+
runs-on: ubuntu-latest
110+
environment: ${{ inputs.network }} # ✅ This gives access to environment secrets
111+
steps:
112+
- name: Call reusable workflow with secrets
113+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/propose-safe-multisig-tx.yml@fix/multisig-rpc-secrets
114+
with:
115+
safe-address: ${{ needs.prepare-transaction-calldata.outputs.safe-address }}
116+
transaction-to: ${{ needs.prepare-transaction-calldata.outputs.bridge-address }}
117+
transaction-data: ${{ needs.prepare-transaction-calldata.outputs.transaction-data }}
118+
dry-run: ${{ inputs.dry-run }}
119+
env:
120+
RPC_URL: ${{ secrets.RPC_URL }}
121+
SAFE_PROPOSER_PRIVATE_KEY: ${{ secrets.SAFE_PROPOSER_PRIVATE_KEY }}
122+
SAFE_API_KEY: ${{ secrets.SAFE_API_KEY }}

0 commit comments

Comments
 (0)