From 1680203b621e23a17e5a399b570815198a92e9f4 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Thu, 7 Aug 2025 17:43:06 +0800 Subject: [PATCH 1/5] "Claude PR Assistant workflow" --- .github/workflows/claude.yml | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/claude.yml diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 0000000..64a3e5b --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,64 @@ +name: Claude Code + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + claude: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + issues: read + id-token: write + actions: read # Required for Claude to read CI results on PRs + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run Claude Code + id: claude + uses: anthropics/claude-code-action@beta + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + + # This is an optional setting that allows Claude to read CI results on PRs + additional_permissions: | + actions: read + + # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4) + # model: "claude-opus-4-20250514" + + # Optional: Customize the trigger phrase (default: @claude) + # trigger_phrase: "/claude" + + # Optional: Trigger when specific user is assigned to an issue + # assignee_trigger: "claude-bot" + + # Optional: Allow Claude to run specific commands + # allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" + + # Optional: Add custom instructions for Claude to customize its behavior for your project + # custom_instructions: | + # Follow our coding standards + # Ensure all new code has tests + # Use TypeScript for new files + + # Optional: Custom environment variables for Claude + # claude_env: | + # NODE_ENV: test + From 2dc30146b1103877596ed9ad72b82bc8affa3e92 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Thu, 7 Aug 2025 17:43:09 +0800 Subject: [PATCH 2/5] "Claude Code Review workflow" --- .github/workflows/claude-code-review.yml | 78 ++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/claude-code-review.yml diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml new file mode 100644 index 0000000..5bf8ce5 --- /dev/null +++ b/.github/workflows/claude-code-review.yml @@ -0,0 +1,78 @@ +name: Claude Code Review + +on: + pull_request: + types: [opened, synchronize] + # Optional: Only run on specific file changes + # paths: + # - "src/**/*.ts" + # - "src/**/*.tsx" + # - "src/**/*.js" + # - "src/**/*.jsx" + +jobs: + claude-review: + # Optional: Filter by PR author + # if: | + # github.event.pull_request.user.login == 'external-contributor' || + # github.event.pull_request.user.login == 'new-developer' || + # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + issues: read + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run Claude Code Review + id: claude-review + uses: anthropics/claude-code-action@beta + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + + # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4) + # model: "claude-opus-4-20250514" + + # Direct prompt for automated review (no @claude mention needed) + direct_prompt: | + Please review this pull request and provide feedback on: + - Code quality and best practices + - Potential bugs or issues + - Performance considerations + - Security concerns + - Test coverage + + Be constructive and helpful in your feedback. + + # Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR + # use_sticky_comment: true + + # Optional: Customize review based on file types + # direct_prompt: | + # Review this PR focusing on: + # - For TypeScript files: Type safety and proper interface usage + # - For API endpoints: Security, input validation, and error handling + # - For React components: Performance, accessibility, and best practices + # - For tests: Coverage, edge cases, and test quality + + # Optional: Different prompts for different authors + # direct_prompt: | + # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' && + # 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' || + # 'Please provide a thorough code review focusing on our coding standards and best practices.' }} + + # Optional: Add specific tools for running tests or linting + # allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)" + + # Optional: Skip review for certain conditions + # if: | + # !contains(github.event.pull_request.title, '[skip-review]') && + # !contains(github.event.pull_request.title, '[WIP]') + From c5c325c5947ea0d5d1ae0c75c57e3852da6b9e10 Mon Sep 17 00:00:00 2001 From: Srinivas Vaddi Date: Wed, 13 Aug 2025 01:49:56 -0400 Subject: [PATCH 3/5] refactor(url): remove is-url dependency and improve URL validation --- bin/utils/url.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/utils/url.ts b/bin/utils/url.ts index ec0350e..8f1a0ca 100644 --- a/bin/utils/url.ts +++ b/bin/utils/url.ts @@ -1,5 +1,4 @@ import * as psl from 'psl'; -import isUrl from 'is-url'; // Extracts the domain from a given URL. export function getDomain(inputUrl: string): string | null { @@ -32,10 +31,10 @@ export function appendProtocol(inputUrl: string): string { // Normalizes the URL by ensuring it has a protocol and is valid. export function normalizeUrl(urlToNormalize: string): string { const urlWithProtocol = appendProtocol(urlToNormalize); - - if (isUrl(urlWithProtocol)) { + try { + new URL(urlWithProtocol); return urlWithProtocol; - } else { - throw new Error(`Your url "${urlWithProtocol}" is invalid`); + } catch (err) { + throw new Error(`Your url "${urlWithProtocol}" is invalid: ${(err as Error).message}`); } } From 9218efcfd19a240fd03bcf09a5cb205d16e83171 Mon Sep 17 00:00:00 2001 From: Srinivas Vaddi Date: Wed, 13 Aug 2025 02:01:12 -0400 Subject: [PATCH 4/5] refactor(dependencies): remove is-url and its type definitions --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index aed48c6..42b7590 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "commander": "^11.1.0", "file-type": "^18.7.0", "fs-extra": "^11.2.0", - "is-url": "^1.2.4", "loglevel": "^1.9.2", "ora": "^7.0.1", "prompts": "^2.4.2", @@ -70,7 +69,6 @@ "@rollup/plugin-replace": "^5.0.7", "@rollup/plugin-terser": "^0.4.4", "@types/fs-extra": "^11.0.4", - "@types/is-url": "^1.2.32", "@types/node": "^20.17.10", "@types/page-icon": "^0.3.6", "@types/prompts": "^2.4.9", From c233e5077d2b151b1344e195e588f4c8510d7002 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Wed, 13 Aug 2025 15:34:58 +0800 Subject: [PATCH 5/5] docs(contributor): contrib-readme-action has updated readme --- README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1debd83..559c903 100644 --- a/README.md +++ b/README.md @@ -315,6 +315,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c Matt Bajorek + + + vaddisrinivas +
+ Srinivas Vaddi +
+ QingZ11 @@ -349,15 +356,15 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Kieran
- + + exposir
孟世博
- - + 2nthony @@ -399,15 +406,15 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Dengju Deng
- + + Fechin
Fechin
- - + ImgBotApp @@ -449,15 +456,15 @@ Pake's development can not be without these Hackers. They contributed a lot of c
Null
- + + geekvest
Null
- - + houhoz