Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
76f06e4
add new reusable workflow
Le-Caignec Sep 29, 2025
d5348b4
refactor: rename target-address to transaction-target-address in READ…
Le-Caignec Sep 29, 2025
e8d2f0d
chore: update changelog and version to 1.0.0 for safe transaction wor…
Le-Caignec Sep 29, 2025
173fe2c
chore: remove unused keywords from package.json
Le-Caignec Sep 29, 2025
7594f41
chore: update README to reflect workflow usage changes and remove obs…
Le-Caignec Sep 29, 2025
f73ecf3
chore: remove unnecessary blank line in README for improved readability
Le-Caignec Sep 29, 2025
7c00a1a
chore: remove redundant prepare script from package.json
Le-Caignec Sep 29, 2025
f02f608
chore: move proposer-private-key and safe-api-key to secrets in workf…
Le-Caignec Sep 30, 2025
6f5048e
chore: remove npm cache configuration from Node.js setup
Le-Caignec Sep 30, 2025
b55b464
chore: add ref to checkout step in safe-transaction workflow for testing
Le-Caignec Sep 30, 2025
bf66243
chore: add prepare script to package.json and clarify operation type …
Le-Caignec Sep 30, 2025
3937ebf
refactor: update Safe initialization method from init to create for c…
Le-Caignec Sep 30, 2025
dede1f4
refactor: enhance wallet initialization with provider and integrate E…
Le-Caignec Sep 30, 2025
050343b
style: standardize quotation marks in index.js for consistency
Le-Caignec Sep 30, 2025
26ffd84
feat: add debug logging for safe transaction data and specify origin …
Le-Caignec Sep 30, 2025
e6ffa2b
feat: add transaction service URL for Safe API initialization
Le-Caignec Sep 30, 2025
8c0609c
feat: add debug logging for API Kit initialization in safe transaction
Le-Caignec Sep 30, 2025
775d3d7
feat: enhance debug logging for safe transaction process and API Kit …
Le-Caignec Sep 30, 2025
e342ecb
refactor: simplify wallet and Safe initialization by removing unneces…
Le-Caignec Sep 30, 2025
29b20ed
refactor: remove chain-id input from workflow and update dependencies…
Le-Caignec Oct 1, 2025
f311f20
refactor: update dependencies and improve Safe transaction proposal p…
Le-Caignec Oct 1, 2025
bcfbab4
refactor: update API Kit and Protocol Kit initialization to use defau…
Le-Caignec Oct 1, 2025
2bf8c42
refactor: update API and Protocol Kit initialization to remove defaul…
Le-Caignec Oct 1, 2025
1f99488
refactor: remove module type declaration from package.json
Le-Caignec Oct 1, 2025
5b9f285
refactor: add chain-id input to workflow and update README and index.…
Le-Caignec Oct 1, 2025
661e17a
refactor: move chain-id input definition to the correct position in t…
Le-Caignec Oct 1, 2025
b801503
refactor: rename transaction-target-address to transaction-to for con…
Le-Caignec Oct 1, 2025
35f9e3e
refactor: update Node.js version from 20 to 22 in workflow
Le-Caignec Oct 1, 2025
38e65d4
refactor: add origin field to transaction proposal for GitHub Action …
Le-Caignec Oct 1, 2025
a5e6179
Update safe-transaction/README.md
Le-Caignec Oct 6, 2025
ee4652b
refactor: remove chain-id input and detect it from RPC URL in workflow
Le-Caignec Oct 6, 2025
431dbe9
refactor: replace ethers with viem for wallet and chain ID detection
Le-Caignec Oct 6, 2025
d0fb368
Update safe-transaction/package.json
Le-Caignec Oct 6, 2025
cdce1c5
Update safe-transaction/package.json
Le-Caignec Oct 6, 2025
e385fb2
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
249d380
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
b218e87
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
2fbdac7
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
e07a297
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
51b4bc9
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
2f94c28
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
24748ea
Update .github/workflows/safe-transaction.yml
Le-Caignec Oct 6, 2025
d9fdd7d
feat: add reusable workflow for proposing Safe multisig transactions
Le-Caignec Oct 6, 2025
b5b9a72
feat: add environment variable validation and update dependencies
Le-Caignec Oct 6, 2025
739c62c
refactor: streamline transaction proposal logic and enhance error han…
Le-Caignec Oct 6, 2025
cb52719
feat: update Safe multisig transaction workflow to use new environmen…
Le-Caignec Oct 6, 2025
50bab48
feat: enhance validation for SAFE_PROPOSER_PRIVATE_KEY in environment…
Le-Caignec Oct 6, 2025
cc68147
chore: remove redundant chain ID detection logs from transaction prop…
Le-Caignec Oct 6, 2025
24fdeed
fix: update workflow name to 'Propose Safe Multisig Transaction' for …
Le-Caignec Oct 6, 2025
412a507
Update propose-safe-multisig-tx/src/index.ts
Le-Caignec Oct 6, 2025
0975f46
Update propose-safe-multisig-tx/src/index.ts
Le-Caignec Oct 6, 2025
5e3a913
Update propose-safe-multisig-tx/src/index.ts
Le-Caignec Oct 6, 2025
66d320a
Update propose-safe-multisig-tx/README.md
Le-Caignec Oct 6, 2025
798b03d
feat: update workflow example for contract upgrade process
Le-Caignec Oct 6, 2025
6466540
Merge branch 'feature/add-safe-transaction-reusable-workflow' of http…
Le-Caignec Oct 6, 2025
5bbb655
chore: remove temporary reference for testing in workflow
Le-Caignec Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/safe-transaction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: 'Safe Transaction Proposer'
on:
workflow_call:
inputs:
rpc-url:
description: 'RPC URL for the blockchain network'
required: true
type: string
safe-address:
description: 'Address of the Safe contract'
required: true
type: string
transaction-target-address:
description: 'Target address for the transaction'
required: true
type: string
chain-id:
description: 'Chain ID of the blockchain network (default: 42161 for Arbitrum)'
required: false
default: '42161'
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 (default: 0x)'
required: false
default: '0x'
type: string
secrets:
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:
safe-tx-hash:
description: 'Hash of the Safe transaction'
value: ${{ jobs.propose-transaction.outputs.safe-tx-hash }}
transaction:
description: 'Created transaction details'
value: ${{ jobs.propose-transaction.outputs.transaction }}

jobs:
propose-transaction:
runs-on: ubuntu-latest
outputs:
safe-tx-hash: ${{ steps.safe-transaction.outputs.safe-tx-hash }}
transaction: ${{ steps.safe-transaction.outputs.transaction }}

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: '20'

- name: Install dependencies
run: npm ci
working-directory: ./safe-transaction

- name: Build action
run: npm run build
working-directory: ./safe-transaction

- name: Propose Safe Transaction
run: node dist/index.js
working-directory: ./safe-transaction
env:
INPUT_PROPOSER_PRIVATE_KEY: ${{ secrets.proposer-private-key }}
INPUT_SAFE_API_KEY: ${{ secrets.safe-api-key }}
INPUT_RPC_URL: ${{ inputs.rpc-url }}
INPUT_SAFE_ADDRESS: ${{ inputs.safe-address }}
INPUT_TARGET_ADDRESS: ${{ inputs.transaction-target-address }}
INPUT_CHAIN_ID: ${{ inputs.chain-id }}
INPUT_TRANSACTION_VALUE: ${{ inputs.transaction-value }}
INPUT_TRANSACTION_DATA: ${{ inputs.transaction-data }}
id: safe-transaction
22 changes: 22 additions & 0 deletions safe-transaction/.gitignore
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
7 changes: 7 additions & 0 deletions safe-transaction/CHANGELOG.md
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))
75 changes: 75 additions & 0 deletions safe-transaction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Safe Transaction Proposer - Reusable Workflow

## Overview 🌟

This reusable GitHub Actions workflow automates the process of creating and proposing transactions to a Safe multi-signature wallet (Gnosis Safe). It handles the complete transaction lifecycle from creation to proposal submission, making it easy to integrate Safe transactions into your CI/CD pipeline.

## Workflow Inputs 🛠️

| **Input** | **Description** | **Required** | **Default** |
| ------------------------ | ------------------------------------------------------------- | ------------ | ----------------------------------- |
| **proposer-private-key** | Private key of the proposer wallet | Yes | - |
| **rpc-url** | RPC URL for the blockchain network | Yes | - |
| **safe-address** | Address of the Safe contract | Yes | - |
| **transaction-target-address** | Target address for the transaction | Yes | - |
| **safe-api-key** | Safe API key for transaction service | Yes | - |
| **chain-id** | Chain ID of the blockchain network | No | `42161` (Arbitrum) |
| **transaction-value** | Value to send in the transaction (in wei) | No | `0` |
| **transaction-data** | Transaction data/calldata | No | `0x` |

## Workflow Outputs 📤

| **Output** | **Description** |
| ----------------- | ----------------------------------------- |
| **safe-tx-hash** | Hash of the Safe transaction created |
| **transaction** | Complete transaction details (JSON) |

## Secrets 🔐

| **Secret** | **Description** | **Required** |
| ------------------------- | -------------------------------------------------- | ------------ |
| **PROPOSER_PRIVATE_KEY** | Private key of the proposer wallet | Yes |
| **SAFE_API_KEY** | Safe API key for transaction service | Yes |

## How to Use This Reusable Workflow 🔄

1. **Call the Reusable Workflow**
In another workflow file, invoke this reusable workflow like so:

```yaml
name: Propose Safe Transaction
on:
workflow_dispatch:
inputs:
safe-address:
description: 'Safe contract address'
required: true
transaction-target-address:
description: 'Target contract address'
required: true
transaction-data:
description: 'Transaction data (0x prefixed)'
required: false
default: '0x'

jobs:
safe-transaction:
uses: ./.github/workflows/safe-transaction.yml
secrets:
proposer-private-key: ${{ secrets.PROPOSER_PRIVATE_KEY }}
rpc-url: ${{ vars.RPC_URL }}
safe-api-key: ${{ secrets.SAFE_API_KEY }}
with:
safe-address: ${{ inputs.safe-address }}
transaction-target-address: ${{ inputs.transaction-target-address }}
transaction-data: ${{ inputs.transaction-data }}
```

2. **Configure Secrets**
Ensure that the required secrets are added to your repository's settings:
- `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.
Loading