Skip to content
Open
Changes from all commits
Commits
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
140 changes: 138 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,138 @@
# github-actions
Shared actions and workflows
# WalletConnect GitHub Actions

Shared GitHub Actions and reusable workflows for infrastructure, deployments, and AI-powered code review.

## Directory Structure

```
.
├── actions/ # High-level composite actions
│ ├── deploy-terraform/ # Complete Terraform deployment
│ ├── deploy-ecs/ # ECS service deployment
│ ├── plan-terraform/ # Terraform planning
│ └── fmt-check-terraform/ # Terraform formatting check
├── terraform/ # Terraform primitives
│ ├── init/ # Initialize Terraform
│ ├── plan/ # Generate execution plan
│ ├── apply/ # Apply changes
│ ├── validate/ # Validate configuration
│ ├── select-workspace/ # Switch workspace
│ └── check-fmt/ # Format checking
├── aws/ # AWS-specific actions
│ ├── ecs/ # ECS operations (deploy-image, get-task-image)
│ └── grafana/ # Grafana key management
├── github/ # GitHub utilities
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto Review Issue: Missing github subdirectories in structure

Severity: LOW
Category: documentation
Tool: Claude Auto Review

Recommendation: Add the missing directories to maintain accuracy:

├── github/          # GitHub utilities
│   ├── paths-filter/         # Path-based filtering
│   ├── branch-name/          # Branch name utilities
│   ├── latest-release-version/  # Release versioning
│   ├── latest_release/       # Release utilities
│   ├── update-release-version/  # Update release versions
│   ├── update-rust-version/  # Update Rust versions
│   └── cta-assistant/        # CTA assistant

│ ├── paths-filter/ # Path-based filtering
│ ├── branch-name/ # Branch name utilities
│ ├── latest-release-version/ # Release versioning
│ ├── update-release-version/ # Update release versions
│ └── cta-assistant/ # CTA assistant
├── claude/ # AI-powered review
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto Review Issue: Missing claude/agent directory in structure

Severity: LOW
Category: documentation
Tool: Claude Auto Review

Recommendation: Add description for the agent action in the Claude Auto-Review section or clarify its relationship to the general AI agent invocation workflow.

│ ├── agent/ # Generic Claude agent handling
│ ├── auto-review/ # PR code review with inline comments
│ └── terraform-plan-review/ # Terraform plan analysis
└── deploy-window/ # Deploy timing controls
```

## Quick Start

### Deploy Terraform Infrastructure

```yaml
- uses: WalletConnect/actions/actions/deploy-terraform@master
with:
environment: staging
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
```

### Deploy ECS Service

```yaml
- uses: WalletConnect/actions/actions/deploy-ecs@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
cluster-name: my-cluster
service-name: my-service
task-definition-name: my-task
image-name: my-image:v1.0.0
```

### AI Code Review

```yaml
- uses: WalletConnect/actions/claude/auto-review@master
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
model: claude-sonnet-4-5-20250929
project_context: |
This is a payment processing service using Node.js and TypeScript.
```

## Key Conventions

### Composite Actions
- All actions use `using: composite` with bash steps
- Inputs use kebab-case naming
- Outputs written via `>> $GITHUB_OUTPUT`
- Use `working-directory` field over `cd` in scripts

### Terraform Usage
- Set environment via `TF_WORKSPACE` env var
- Run non-interactively with `-no-color` and `TF_INPUT=0`
- Apply with `-auto-approve`
- Var files located at `vars/{environment}.tfvars`

### AWS Usage
- Configure credentials with `aws-actions/configure-aws-credentials@v4`
- Always require explicit region input
- Grafana keys have short TTL, cleanup via `always()` condition

### Security
- Mask sensitive values with `::add-mask::`
- External domains limited to: reown.com, walletconnect.com, walletconnect.org
- Cleanup temporary credentials/keys in `always()` steps

### Action References
- Consumers should pin to full 40-char commit SHA, not branch names
- Internal action refs use `@master` for this repo

## Development

### Auto-Review Tests

```bash
cd claude/auto-review
pnpm install # Install dependencies
pnpm test # Run tests
pnpm test:watch # Watch mode
pnpm test:coverage # With coverage
```

### Pre-commit Hooks

```bash
pre-commit install # Install hooks
pre-commit run --all-files # Run all checks
```

## Claude Auto-Review

The `claude/auto-review` action provides automated PR reviews with inline findings comments.

**Key components:**
- `action.yml` - Main composite action with dynamic prompt generation
- `scripts/extract-findings-from-comment.js` - Parses AI comment to extract structured findings
- `scripts/comment-pr-findings.js` - Posts inline PR review comments from findings.json
- `scripts/lib/github-utils.js` - Shared utilities (gh CLI wrapper, context loading)

**Flow:** AI agent reviews PR → posts comment → extract-findings parses issues → comment-pr-findings posts inline comments

## Workflows

- `.github/workflows/claude.yml` - General AI agent invocation (@claude mentions)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto Review Issue: Inconsistent workflow description

Severity: LOW
Category: documentation
Tool: Claude Auto Review

Recommendation: Update line 136 to match CLAUDE.md:

- `.github/workflows/claude.yml` - General AI agent invocation (@claude mentions, excluding @claude review)

- `.github/workflows/claude-review.yml` - Auto-review on PR open or @claude review comment
- `.github/workflows/test-claude-auto-review.yml` - CI for auto-review scripts