-
Notifications
You must be signed in to change notification settings - Fork 5
automation #55
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
automation #55
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| name: AI On-Demand Assistant | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| pull_request_review: | ||
| types: [submitted] | ||
| issues: | ||
| types: [opened] | ||
|
|
||
| jobs: | ||
| ai-response: | ||
| # Only run if the app is mentioned and it's not the app itself commenting | ||
| if: | | ||
| ( | ||
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@efp-dev-ops')) || | ||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@efp-dev-ops')) || | ||
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@efp-dev-ops')) || | ||
| (github.event_name == 'issues' && contains(github.event.issue.body, '@efp-dev-ops')) | ||
| ) && contains(fromJSON(vars.ALLOWED_USER_LIST), github.actor) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Generate Custom App Token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@v1 | ||
| with: | ||
| app-id: ${{ secrets.APP_ID }} | ||
| private-key: ${{ secrets.PRIVATE_KEY }} | ||
|
|
||
| - name: Extract Instruction from Comment | ||
| id: extract-instruction | ||
| env: | ||
| ISSUE_COMMENT_BODY: ${{ github.event.comment.body }} | ||
| PR_REVIEW_COMMENT_BODY: ${{ github.event.comment.body }} | ||
| PR_REVIEW_BODY: ${{ github.event.review.body }} | ||
| ISSUE_BODY: ${{ github.event.issue.body }} | ||
| run: | | ||
| # Get the comment body based on event type | ||
| if [ "${{ github.event_name }}" = "issue_comment" ]; then | ||
| COMMENT_BODY="$ISSUE_COMMENT_BODY" | ||
| elif [ "${{ github.event_name }}" = "pull_request_review_comment" ]; then | ||
| COMMENT_BODY="$PR_REVIEW_COMMENT_BODY" | ||
| elif [ "${{ github.event_name }}" = "pull_request_review" ]; then | ||
| COMMENT_BODY="$PR_REVIEW_BODY" | ||
| elif [ "${{ github.event_name }}" = "issues" ]; then | ||
| COMMENT_BODY="$ISSUE_BODY" | ||
| else | ||
| COMMENT_BODY="" | ||
| fi | ||
|
|
||
| # Remove the @mention and get the instruction | ||
| INSTRUCTION=$(echo "$COMMENT_BODY" | sed 's/@efp-dev-ops[[:space:]]*//' | sed 's/^[[:space:]]*//') | ||
|
|
||
| # Add input validation | ||
| if [ ${#INSTRUCTION} -gt 4000 ]; then | ||
| echo "Instruction too long, truncating..." | ||
| INSTRUCTION=$(echo "$INSTRUCTION" | head -c 4000) | ||
| fi | ||
|
|
||
| # Set as output for next step | ||
| echo "instruction<<EOF" >> $GITHUB_OUTPUT | ||
| echo "$INSTRUCTION" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
|
|
||
| echo "Extracted instruction: $INSTRUCTION" | ||
|
|
||
| - name: AI Response | ||
| uses: 0xthrpw/claude-code-action@v0.0.1 | ||
| continue-on-error: true | ||
| timeout-minutes: 10 | ||
| with: | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| github_token: ${{ steps.generate-token.outputs.token }} | ||
| direct_prompt: | | ||
| You are an AI assistant for our development team. A team member has requested help with the following: | ||
|
|
||
| **User Request:** ${{ steps.extract-instruction.outputs.instruction }} | ||
|
|
||
| Please provide a helpful, accurate response. If the request involves code analysis, focus on the current repository context. If it's a general question, provide clear and actionable guidance. | ||
|
|
||
| Keep your response concise but thorough, and format it nicely for GitHub comments. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,77 @@ | ||||||||||||||||||||||
| name: Custom AI Code Review | ||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||
| types: [opened, synchronize, reopened] | ||||||||||||||||||||||
| # issue_comment: | ||||||||||||||||||||||
| # types: [created] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| ai-review: | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||
| issues: write | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - name: Checkout Code | ||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| fetch-depth: 0 # Get full history for better context | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Generate Custom App Token | ||||||||||||||||||||||
| id: generate-token | ||||||||||||||||||||||
| uses: actions/create-github-app-token@v1 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| app-id: ${{ secrets.APP_ID }} | ||||||||||||||||||||||
| private-key: ${{ secrets.PRIVATE_KEY }} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: AI Code Quality Review | ||||||||||||||||||||||
| uses: anthropics/claude-code-action@v0 | ||||||||||||||||||||||
|
Comment on lines
+18
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Tag-only action references – pin to immutable SHAs
uses: actions/checkout@v4 # → actions/checkout@<sha>Repeat for the other two. 🤖 Prompt for AI Agents |
||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||
| timeout-minutes: 10 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||||||||||||||||||||||
| github_token: ${{ steps.generate-token.outputs.token }} | ||||||||||||||||||||||
| direct_prompt: | | ||||||||||||||||||||||
| You are the AI code quality reviewer for our organization. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Please analyze this pull request for: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## 🔍 Code Quality Assessment | ||||||||||||||||||||||
| - Overall code quality rating (1-10) | ||||||||||||||||||||||
| - Code maintainability and readability | ||||||||||||||||||||||
| - Adherence to best practices | ||||||||||||||||||||||
| - Performance considerations | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## 📚 Documentation Review | ||||||||||||||||||||||
| - Comment quality and completeness | ||||||||||||||||||||||
| - Function/method documentation | ||||||||||||||||||||||
| - README updates if needed | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## 🎯 Specific Recommendations | ||||||||||||||||||||||
| - Actionable improvements with priorities | ||||||||||||||||||||||
| - Code refactoring suggestions | ||||||||||||||||||||||
| - Testing recommendations | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Format your response as a professional code review. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Post Summary Comment | ||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| gh pr comment ${{ github.event.number }} --body " | ||||||||||||||||||||||
| ## 🤖 AI Code Review Complete | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Your custom AI assistant has completed the automated code review process. | ||||||||||||||||||||||
|
Comment on lines
+61
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect event field – For a -gh pr comment ${{ github.event.number }} --body "
+gh pr comment ${{ github.event.pull_request.number }} --body "📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ✅ Security analysis finished | ||||||||||||||||||||||
| ✅ Code quality assessment complete | ||||||||||||||||||||||
| ✅ Documentation review done | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Please review the detailed feedback above and address any high-priority items before merging. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| --- | ||||||||||||||||||||||
| *This automated review was performed by EFP-DEV-OPS* | ||||||||||||||||||||||
| " | ||||||||||||||||||||||
| env: | ||||||||||||||||||||||
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| # CLAUDE.md - Ethereum Follow Protocol Documentation | ||
|
|
||
| ## Overview | ||
| This is the documentation repository for the Ethereum Follow Protocol (EFP), an onchain social graph protocol for Ethereum accounts. The repository contains comprehensive technical documentation built with Astro and Starlight. | ||
|
|
||
| ## Tech Stack | ||
| - **Framework**: Astro (v4.2.4) with Starlight documentation theme | ||
| - **Language**: TypeScript | ||
| - **Styling**: Tailwind CSS with custom styles | ||
| - **Package Manager**: Bun (v1.0.25) | ||
| - **Build Tool**: Astro build system | ||
| - **Deployment**: Static site generation | ||
|
|
||
| ## Key Scripts | ||
| - `bun run dev` - Start development server | ||
| - `bun run build` - Build production site | ||
| - `bun run preview` - Preview built site | ||
| - `bun run lint` - Run ESLint with auto-fix | ||
| - `bun run format` - Format code with Prettier | ||
| - `bun run typecheck` - Run TypeScript type checking | ||
| - `bun run clean` - Clean build artifacts and dependencies | ||
|
|
||
| ## Repository Structure | ||
|
|
||
| ### Core Configuration | ||
| - `astro.config.ts` - Main Astro configuration with Starlight setup | ||
| - `package.json` - Dependencies and scripts | ||
| - `tsconfig.json` - TypeScript configuration | ||
| - `tailwind.config.ts` - Tailwind CSS configuration | ||
|
|
||
| ### Content Structure | ||
| - `src/content/docs/` - All documentation MDX files | ||
| - `src/content/config.ts` - Content collection configuration | ||
| - `public/` - Static assets (images, logos, etc.) | ||
|
|
||
| ### Documentation Sections | ||
|
|
||
| #### Introduction (`src/content/docs/intro/`) | ||
| - Core protocol concepts | ||
| - EFP List NFT system | ||
| - Roles (Owner, Manager, User) | ||
| - Tags and social graph mechanics | ||
|
|
||
| #### Specification (`src/content/docs/design/`) | ||
| - `list-registry.mdx` - ERC-721 List Registry contract | ||
| - `roles.mdx` - Role definitions and permissions | ||
| - `account-metadata.mdx` - Account metadata system | ||
| - `list-metadata.mdx` - List metadata structure | ||
| - `list-storage-location.mdx` - Storage location specifications | ||
| - `list-records.mdx` - List record structure | ||
| - `tags.mdx` - Tagging system (block, mute, top8, custom) | ||
| - `list-ops.mdx` - List operations structure | ||
| - `glossary.mdx` - Protocol terminology | ||
|
|
||
| #### Production (`src/content/docs/production/`) | ||
| - `deployments.mdx` - Smart contract addresses (Base, OP Mainnet, Ethereum) | ||
| - `interpreting-state.mdx` - Data interpretation guide | ||
| - `multisig.mdx` - Multisig wallet information | ||
| - `infra.mdx` - Infrastructure overview | ||
| - `silo.mdx` - Railway deployment template | ||
| - `follow-bot.mdx` - Telegram bot functionality | ||
| - `emergency-response.mdx` - Emergency procedures | ||
|
|
||
| #### Additional Content | ||
| - `faq.mdx` - Frequently asked questions | ||
| - `bugbounty.mdx` - Bug bounty program | ||
| - `translationbounty.mdx` - Translation bounty program | ||
| - `llmstxt.mdx` - LLM-friendly protocol documentation | ||
| - `playground/` - Interactive examples | ||
|
|
||
| ### Design Components | ||
| - `design-components/colors.mdx` - Color specifications | ||
| - `design-components/logos.mdx` - Logo assets and usage | ||
|
|
||
| ## Key Features | ||
|
|
||
| ### Protocol Concepts | ||
| - **EFP List NFT**: Free-to-mint NFTs representing social lists | ||
| - **Three-Role System**: Owner, Manager, User with distinct permissions | ||
| - **Multi-Chain Support**: Base, OP Mainnet, Ethereum deployments | ||
| - **Tag System**: Standard tags (block, mute, top8) + custom tags | ||
| - **Primary List**: Account's designated main social graph | ||
|
|
||
| ### Technical Infrastructure | ||
| - **Smart Contracts**: ERC-721 registry, list records, account metadata | ||
| - **API**: Comprehensive REST API via ethidentitykit.com | ||
| - **Indexer**: Open-source indexing system | ||
| - **Multi-Chain**: L1 and L2 deployments | ||
|
|
||
| ### Content Management | ||
| - **MDX Support**: Rich documentation with embedded components | ||
| - **Version Control**: Git-based documentation workflow | ||
| - **Starlight**: Advanced documentation features (search, navigation, theming) | ||
|
|
||
| ## Development Workflow | ||
|
|
||
| ### Adding Documentation | ||
| 1. Create MDX files in appropriate `src/content/docs/` subdirectory | ||
| 2. Update `astro.config.ts` sidebar configuration if needed | ||
| 3. Use frontmatter for page metadata | ||
| 4. Test locally with `bun run dev` | ||
|
|
||
| ### Code Quality | ||
| - **ESLint**: Configured with TypeScript, Astro, and MDX support | ||
| - **Prettier**: Code formatting with Tailwind plugin | ||
| - **TypeScript**: Strict type checking | ||
| - **Link Validation**: Automated internal link checking | ||
|
|
||
| ### Assets | ||
| - **Public Directory**: Static assets accessible at root | ||
| - **Logo Assets**: Multiple formats (PNG, SVG) for different use cases | ||
| - **Images**: Protocol diagrams, screenshots, QR codes | ||
|
|
||
| ## External Resources | ||
|
|
||
| ### API Documentation | ||
| - Comprehensive API docs at ethidentitykit.com | ||
| - Endpoints for users, lists, stats, leaderboards | ||
| - Real-time data via indexer | ||
|
|
||
| ### Related Repositories | ||
| - `app` - Main EFP web application | ||
| - `api` - Public API service | ||
| - `contracts` - Smart contract implementations | ||
| - `indexer` - Data indexing service | ||
| - `services` - Backend services | ||
| - `follow-bot` - Telegram bot | ||
|
|
||
| ### Community | ||
| - **Discord**: https://discord.efp.app | ||
| - **Twitter**: https://x.com/efp | ||
| - **Forum**: https://forum.ethfollow.xyz/ | ||
|
|
||
| ## Deployment Information | ||
|
|
||
| ### Production Contracts | ||
| - **Base**: Full deployment with all contracts | ||
| - **OP Mainnet**: List Records only | ||
| - **Ethereum**: List Records only | ||
|
|
||
| ### Development Environment | ||
| - **Base Sepolia**: Full testnet deployment | ||
| - **OP Sepolia**: List Records testnet | ||
| - **Ethereum Sepolia**: List Records testnet | ||
|
|
||
| ## Security Considerations | ||
| - Bug bounty program active | ||
| - Emergency response procedures documented | ||
| - Multisig wallet governance | ||
| - Open-source codebase for transparency | ||
|
|
||
| ## Contributing | ||
| - Simple contribution guidelines: "good vibes only" | ||
| - Open to community contributions | ||
| - Translation bounty program available | ||
| - GitHub-based workflow with PR previews | ||
|
|
||
| This documentation serves as the canonical technical reference for the Ethereum Follow Protocol, providing comprehensive coverage of the protocol's design, implementation, and operational aspects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard against missing
ALLOWED_USER_LIST– add a default fallback and trim trailing spaceIf
vars.ALLOWED_USER_LISTis not defined the workflow fails at expression-evaluation time.Also, line 21 has a lone trailing space flagged by YAML-lint.
(remove the trailing space at line 21 as well)
📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 21-21: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents