Skip to content

fix: add tooltip and fix missing field custom token #2

fix: add tooltip and fix missing field custom token

fix: add tooltip and fix missing field custom token #2

name: CodeRabbit AI Code Review
# This workflow complements CodeRabbit AI for automated code reviews
#
# Setup Instructions for CodeRabbit:
# 1. Visit https://coderabbit.ai and login with GitHub
# 2. Authorize the CodeRabbit GitHub App
# 3. Select this repository to enable automated reviews
# 4. CodeRabbit will automatically review all pull requests
#
# Note: CodeRabbit works as a GitHub App, not a GitHub Action.
# This workflow provides additional automated checks alongside CodeRabbit.
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- production
- 'feat/**'
pull_request_review:
types: [submitted]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
# Pre-review checks that run before/alongside CodeRabbit
code-quality-checks:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for better analysis
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
**/*.ts
**/*.tsx
**/*.js
**/*.jsx
**/*.json
- name: List changed files
if: steps.changed-files.outputs.any_changed == 'true'
run: |
echo "Changed files:"
echo "${{ steps.changed-files.outputs.all_changed_files }}"
- name: Add PR comment with review info
uses: actions/github-script@v7
if: github.event.action == 'opened'
with:
script: |
const comment = `## Automated Review Status
✅ Code quality checks are running
🤖 CodeRabbit AI will provide an automated review shortly
### What's being checked:
- Code quality and linting
- TypeScript type safety
- Build verification
- Test coverage (if applicable)
### CodeRabbit AI Setup
If you haven't set up CodeRabbit yet:
1. Visit [coderabbit.ai](https://coderabbit.ai)
2. Login with GitHub and authorize the app
3. Enable it for this repository
CodeRabbit will then automatically review all PRs with intelligent feedback.`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
# Linting and formatting checks
lint-check:
name: Lint and Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile || echo "No package.json found or install failed"
continue-on-error: true
- name: Run linter
run: pnpm lint || echo "No lint script configured"
continue-on-error: true
# Build verification
build-check:
name: Build Verification
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile || echo "Install failed"
continue-on-error: true
- name: Build project
run: pnpm build || echo "No build script configured"
continue-on-error: true
# Summary job
review-summary:
name: Review Summary
runs-on: ubuntu-latest
needs: [code-quality-checks, lint-check, build-check]
if: always()
steps:
- name: Check job statuses
uses: actions/github-script@v7
with:
script: |
const jobs = [
{ name: 'Code Quality Checks', status: '${{ needs.code-quality-checks.result }}' },
{ name: 'Lint Check', status: '${{ needs.lint-check.result }}' },
{ name: 'Build Check', status: '${{ needs.build-check.result }}' }
];
const summary = jobs.map(job => {
const emoji = job.status === 'success' ? '✅' :
job.status === 'failure' ? '❌' : '⚠️';
return `${emoji} ${job.name}: ${job.status}`;
}).join('\n');
const comment = `## Automated Checks Summary
${summary}
---
*This automated check works alongside CodeRabbit AI for comprehensive code review.*
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});