-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add new Safe Wallet reusable workflow #85
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
Merged
Le-Caignec
merged 56 commits into
main
from
feature/add-safe-transaction-reusable-workflow
Oct 6, 2025
Merged
Changes from 47 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
76f06e4
add new reusable workflow
Le-Caignec d5348b4
refactor: rename target-address to transaction-target-address in READ…
Le-Caignec e8d2f0d
chore: update changelog and version to 1.0.0 for safe transaction wor…
Le-Caignec 173fe2c
chore: remove unused keywords from package.json
Le-Caignec 7594f41
chore: update README to reflect workflow usage changes and remove obs…
Le-Caignec f73ecf3
chore: remove unnecessary blank line in README for improved readability
Le-Caignec 7c00a1a
chore: remove redundant prepare script from package.json
Le-Caignec f02f608
chore: move proposer-private-key and safe-api-key to secrets in workf…
Le-Caignec 6f5048e
chore: remove npm cache configuration from Node.js setup
Le-Caignec b55b464
chore: add ref to checkout step in safe-transaction workflow for testing
Le-Caignec bf66243
chore: add prepare script to package.json and clarify operation type …
Le-Caignec 3937ebf
refactor: update Safe initialization method from init to create for c…
Le-Caignec dede1f4
refactor: enhance wallet initialization with provider and integrate E…
Le-Caignec 050343b
style: standardize quotation marks in index.js for consistency
Le-Caignec 26ffd84
feat: add debug logging for safe transaction data and specify origin …
Le-Caignec e6ffa2b
feat: add transaction service URL for Safe API initialization
Le-Caignec 8c0609c
feat: add debug logging for API Kit initialization in safe transaction
Le-Caignec 775d3d7
feat: enhance debug logging for safe transaction process and API Kit …
Le-Caignec e342ecb
refactor: simplify wallet and Safe initialization by removing unneces…
Le-Caignec 29b20ed
refactor: remove chain-id input from workflow and update dependencies…
Le-Caignec f311f20
refactor: update dependencies and improve Safe transaction proposal p…
Le-Caignec bcfbab4
refactor: update API Kit and Protocol Kit initialization to use defau…
Le-Caignec 2bf8c42
refactor: update API and Protocol Kit initialization to remove defaul…
Le-Caignec 1f99488
refactor: remove module type declaration from package.json
Le-Caignec 5b9f285
refactor: add chain-id input to workflow and update README and index.…
Le-Caignec 661e17a
refactor: move chain-id input definition to the correct position in t…
Le-Caignec b801503
refactor: rename transaction-target-address to transaction-to for con…
Le-Caignec 35f9e3e
refactor: update Node.js version from 20 to 22 in workflow
Le-Caignec 38e65d4
refactor: add origin field to transaction proposal for GitHub Action …
Le-Caignec a5e6179
Update safe-transaction/README.md
Le-Caignec ee4652b
refactor: remove chain-id input and detect it from RPC URL in workflow
Le-Caignec 431dbe9
refactor: replace ethers with viem for wallet and chain ID detection
Le-Caignec d0fb368
Update safe-transaction/package.json
Le-Caignec cdce1c5
Update safe-transaction/package.json
Le-Caignec e385fb2
Update .github/workflows/safe-transaction.yml
Le-Caignec 249d380
Update .github/workflows/safe-transaction.yml
Le-Caignec b218e87
Update .github/workflows/safe-transaction.yml
Le-Caignec 2fbdac7
Update .github/workflows/safe-transaction.yml
Le-Caignec e07a297
Update .github/workflows/safe-transaction.yml
Le-Caignec 51b4bc9
Update .github/workflows/safe-transaction.yml
Le-Caignec 2f94c28
Update .github/workflows/safe-transaction.yml
Le-Caignec 24748ea
Update .github/workflows/safe-transaction.yml
Le-Caignec d9fdd7d
feat: add reusable workflow for proposing Safe multisig transactions
Le-Caignec b5b9a72
feat: add environment variable validation and update dependencies
Le-Caignec 739c62c
refactor: streamline transaction proposal logic and enhance error han…
Le-Caignec cb52719
feat: update Safe multisig transaction workflow to use new environmen…
Le-Caignec 50bab48
feat: enhance validation for SAFE_PROPOSER_PRIVATE_KEY in environment…
Le-Caignec cc68147
chore: remove redundant chain ID detection logs from transaction prop…
Le-Caignec 24fdeed
fix: update workflow name to 'Propose Safe Multisig Transaction' for …
Le-Caignec 412a507
Update propose-safe-multisig-tx/src/index.ts
Le-Caignec 0975f46
Update propose-safe-multisig-tx/src/index.ts
Le-Caignec 5e3a913
Update propose-safe-multisig-tx/src/index.ts
Le-Caignec 66d320a
Update propose-safe-multisig-tx/README.md
Le-Caignec 798b03d
feat: update workflow example for contract upgrade process
Le-Caignec 6466540
Merge branch 'feature/add-safe-transaction-reusable-workflow' of http…
Le-Caignec 5bbb655
chore: remove temporary reference for testing in workflow
Le-Caignec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: 'Safe Transaction Proposer' | ||
Le-Caignec marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| rpc-url: | ||
Le-Caignec marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| description: 'RPC URL for the blockchain network' | ||
| required: true | ||
| type: string | ||
| safe-address: | ||
| description: 'Address of the Safe contract' | ||
| required: true | ||
| type: string | ||
| transaction-to: | ||
| description: 'Target address of the transaction' | ||
| required: true | ||
| type: string | ||
| transaction-value: | ||
| description: 'Value to send in the transaction (in wei, default: 0)' | ||
| required: false | ||
| default: '0' | ||
| type: string | ||
| transaction-data: | ||
| description: 'Transaction data/calldata' | ||
| required: true | ||
| type: string | ||
| secrets: | ||
| safe-proposer-private-key: | ||
| description: 'Private key of the proposer wallet' | ||
| required: true | ||
| safe-api-key: | ||
| description: 'Safe API key for transaction service' | ||
| required: true | ||
| outputs: | ||
| tx-hash: | ||
| description: 'Hash of the Safe transaction' | ||
| value: ${{ jobs.propose-transaction.outputs.tx-hash }} | ||
| tx-details: | ||
| description: 'Created transaction details' | ||
| value: ${{ jobs.propose-transaction.outputs.tx-details }} | ||
|
|
||
| jobs: | ||
| propose-transaction: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| tx-hash: ${{ steps.safe-transaction.outputs.tx-hash }} | ||
| tx-details: ${{ steps.safe-transaction.outputs.tx-details }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: iExecBlockchainComputing/github-actions-workflows | ||
| # TODO: Only for testing, remove before merging | ||
| ref: feature/add-safe-transaction-reusable-workflow | ||
|
||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
| working-directory: ./propose-safe-multisig-tx | ||
|
|
||
| - name: Build action | ||
| run: npm run build | ||
| working-directory: ./propose-safe-multisig-tx | ||
|
|
||
| - name: Propose Safe Transaction | ||
| run: npm run propose | ||
| working-directory: ./propose-safe-multisig-tx | ||
| env: | ||
| RPC_URL: ${{ inputs.rpc-url }} | ||
| SAFE_ADDRESS: ${{ inputs.safe-address }} | ||
| TRANSACTION_TO: ${{ inputs.transaction-to }} | ||
| TRANSACTION_VALUE: ${{ inputs.transaction-value }} | ||
| TRANSACTION_DATA: ${{ inputs.transaction-data }} | ||
| SAFE_PROPOSER_PRIVATE_KEY: ${{ secrets.safe-proposer-private-key }} | ||
| SAFE_API_KEY: ${{ secrets.safe-api-key }} | ||
| id: safe-transaction | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build outputs | ||
| dist/ | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Environment variables | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Changelog | ||
|
|
||
| ## 1.0.0 (2025-09-29) | ||
|
|
||
| ### Features | ||
|
|
||
| * **safe-transaction:** add workflow for safe transaction submission ([#85](https://github.com/iExecBlockchainComputing/github-actions-workflows/pull/85)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # Safe Multisig Transaction Proposer - Reusable Workflow | ||
|
|
||
| ## Overview 🌟 | ||
|
|
||
| This reusable GitHub Actions workflow automates the process of proposing transactions to a Safe multi-signature wallet (Gnosis Safe). It handles the proposal submission, making it easy to integrate Safe transactions into your CI/CD pipeline. | ||
|
|
||
| **🤖 Smart Chain Detection**: The workflow automatically detects the blockchain network's Chain ID from the provided RPC URL, eliminating the need to manually specify it. | ||
Le-Caignec marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Workflow Inputs 🛠️ | ||
|
|
||
| | **Input** | **Description** | **Required** | **Default** | | ||
| | ------------------------ | ------------------------------------------------------------- | ------------ | ----------------------------------- | | ||
| | **rpc-url** | RPC URL for the blockchain network | Yes | - | | ||
| | **safe-address** | Address of the Safe contract | Yes | - | | ||
| | **transaction-to** | Target address for the transaction | Yes | - | | ||
| | **transaction-value** | Value to send in the transaction (in wei) | No | `0` | | ||
| | **transaction-data** | Transaction data/calldata | No | `0x` | | ||
Le-Caignec marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| | **safe-proposer-private-key** | Private key of the proposer wallet | Yes (Secret) | - | | ||
| | **safe-api-key** | Safe API key for transaction service | Yes (Secret) | - | | ||
|
|
||
| ## Workflow Outputs 📤 | ||
|
|
||
| | **Output** | **Description** | | ||
| | ----------------- | ----------------------------------------- | | ||
| | **tx-hash** | Hash of the Safe transaction created | | ||
| | **tx-details** | Complete transaction details (JSON) | | ||
|
|
||
| ## How to Use This Reusable Workflow 🔄 | ||
|
|
||
| 1. **Call the Reusable Workflow** | ||
| In another workflow file, invoke this reusable workflow like so: | ||
|
|
||
| ```yaml | ||
Le-Caignec marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| name: Propose Safe Transaction | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| safe-address: | ||
| description: 'Safe contract address' | ||
| required: true | ||
| transaction-to: | ||
| description: 'Target contract address' | ||
| required: true | ||
| transaction-data: | ||
| description: 'Transaction data (0x prefixed)' | ||
| required: false | ||
| default: '0x' | ||
|
|
||
| jobs: | ||
| safe-transaction: | ||
| uses: ./.github/workflows/propose-safe-multisig-tx.yml | ||
| secrets: | ||
| safe-proposer-private-key: ${{ secrets.SAFE_PROPOSER_PRIVATE_KEY }} | ||
| safe-api-key: ${{ secrets.SAFE_API_KEY }} | ||
| with: | ||
| rpc-url: ${{ vars.RPC_URL }} | ||
| safe-address: ${{ inputs.safe-address }} | ||
| transaction-to: ${{ inputs.transaction-to }} | ||
| transaction-value: ${{ inputs.transaction-value }} | ||
| transaction-data: ${{ inputs.transaction-data }} | ||
| ``` | ||
|
|
||
| 2. **Configure Secrets** | ||
| Ensure that the required secrets are added to your repository's settings: | ||
| - `SAFE_PROPOSER_PRIVATE_KEY`: The private key of the wallet that will propose the transaction | ||
| - `SAFE_API_KEY`: Your Safe API key for the transaction service | ||
|
|
||
| ## Security Considerations 🛡️ | ||
|
|
||
| ⚠️ **Important**: Never expose private keys in logs or code files. Always use GitHub Secrets to store sensitive information securely. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.