From f77719716f2b9bdd516f516d633a98da1b2b91b5 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Fri, 19 Sep 2025 09:28:04 +0200 Subject: [PATCH] chore: remove deprecated Claude workflows - Delete `claude-implement-issue.yml` and `claude-pr-assistant.yml` workflows - Streamline repository automation by removing redundant workflows - Prepare for future updates with simplified automation setup --- .github/workflows/claude-implement-issue.yml | 197 ------------------- .github/workflows/claude-pr-assistant.yml | 172 ---------------- 2 files changed, 369 deletions(-) delete mode 100644 .github/workflows/claude-implement-issue.yml delete mode 100644 .github/workflows/claude-pr-assistant.yml diff --git a/.github/workflows/claude-implement-issue.yml b/.github/workflows/claude-implement-issue.yml deleted file mode 100644 index 2f10f8e..0000000 --- a/.github/workflows/claude-implement-issue.yml +++ /dev/null @@ -1,197 +0,0 @@ -name: Claude Issue Implementation - -on: - issue_comment: - types: [created] - -permissions: - contents: write - issues: write - pull-requests: write - id-token: write - -jobs: - claude-implement: - if: | - github.event.issue_comment.issue.state == 'open' && - ( - contains(github.event.comment.body, '@claude implement') || - contains(github.event.comment.body, '@claude fix') || - contains(github.event.comment.body, '@claude create') - ) - runs-on: ubuntu-latest - - steps: - - name: Check user permissions - uses: actions/github-script@v7 - with: - script: | - if (context.actor !== 'bvdaakster') { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: 'āŒ **Access Denied**: Only bvdaakster can use Claude implementation.' - }); - throw new Error('Unauthorized user'); - } - - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - - - name: Install pnpm - run: npm install -g pnpm@10.12.4 - - - name: Create branch - id: create-branch - run: | - BRANCH_NAME="claude/issue-${{ github.event.issue.number }}-$(date +%Y%m%d-%H%M%S)" - echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT - git checkout -b "$BRANCH_NAME" - git push origin "$BRANCH_NAME" - - - name: Notify start - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `šŸ¤– **Claude Implementation Started**\n\nšŸ“‹ **Issue**: #${{ github.event.issue.number }}\n🌿 **Branch**: \`${{ steps.create-branch.outputs.branch_name }}\`\n\nImplementing your request...` - }); - - - name: Implement with Claude - uses: anthropics/claude-code-action@beta - with: - claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} - direct_prompt: | - Please implement the feature or fix described in this GitHub issue: - - **Issue #${{ github.event.issue.number }}**: ${{ github.event.issue.title }} - - **Issue Description**: - ${{ github.event.issue.body }} - - **User Request**: - ${{ github.event.comment.body }} - - **Instructions**: - 1. Analyze the issue requirements carefully - 2. Follow existing code patterns and conventions - 3. Use TypeScript with proper typing - 4. Follow ESM module structure with .js extensions - 5. Add tests if needed - 6. Update documentation if necessary - - This is the @xtr-dev/payload-billing plugin for PayloadCMS. - allowed_tools: "Bash(pnpm build),Bash(pnpm typecheck),Bash(pnpm lint),Bash(npm run test)" - - - name: Check for changes - id: changes - run: | - if git diff --quiet && git diff --cached --quiet; then - echo "has_changes=false" >> $GITHUB_OUTPUT - else - echo "has_changes=true" >> $GITHUB_OUTPUT - fi - - - name: Commit and push - if: steps.changes.outputs.has_changes == 'true' - run: | - git config --local user.email "action@github.com" - git config --local user.name "Claude Implementation Bot" - git add . - git commit -m "feat: implement issue #${{ github.event.issue.number }} - - Implemented via Claude automation. - - Issue: #${{ github.event.issue.number }} - Requested by: @${{ github.event.comment.user.login }} - - šŸ¤– Generated with Claude Code - - Co-Authored-By: Claude " - git push origin ${{ steps.create-branch.outputs.branch_name }} - - - name: Create PR - if: steps.changes.outputs.has_changes == 'true' - uses: actions/github-script@v7 - id: create-pr - with: - script: | - const { data: pr } = await github.rest.pulls.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: `šŸ¤– Implement: ${{ github.event.issue.title }}`, - head: '${{ steps.create-branch.outputs.branch_name }}', - base: 'dev', - body: `## šŸ¤– Claude Implementation - - This PR implements issue #${{ github.event.issue.number }}. - - **Issue**: #${{ github.event.issue.number }} - **Requested by**: @${{ github.event.comment.user.login }} - **Branch**: \`${{ steps.create-branch.outputs.branch_name }}\` - - ### Review Checklist - - [ ] Code follows project conventions - - [ ] Build passes - - [ ] Tests pass - - [ ] Implementation matches requirements - - Closes #${{ github.event.issue.number }} - - šŸ¤– Generated with Claude Code` - }); - return pr.number; - - - name: Notify success - if: steps.changes.outputs.has_changes == 'true' - uses: actions/github-script@v7 - with: - script: | - const prNumber = '${{ steps.create-pr.outputs.result }}'; - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `āœ… **Implementation Complete!**\n\nšŸŽÆ **Pull Request**: #${prNumber}\n🌿 **Branch**: \`${{ steps.create-branch.outputs.branch_name }}\`\n\nReady for review! šŸš€` - }); - - - name: Handle no changes - if: steps.changes.outputs.has_changes == 'false' - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `ā„¹ļø **No Changes Needed**\n\nI analyzed the issue but no code changes are required.` - }); - - - name: Clean up on no changes - if: steps.changes.outputs.has_changes == 'false' - run: git push origin --delete ${{ steps.create-branch.outputs.branch_name }} || true - - - name: Handle failure - if: failure() - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `āŒ **Implementation Failed**\n\nCheck the [workflow logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.` - }); \ No newline at end of file diff --git a/.github/workflows/claude-pr-assistant.yml b/.github/workflows/claude-pr-assistant.yml deleted file mode 100644 index 7441a9d..0000000 --- a/.github/workflows/claude-pr-assistant.yml +++ /dev/null @@ -1,172 +0,0 @@ -name: Claude PR Assistant - -on: - issue_comment: - types: [created] - -permissions: - contents: write - issues: write - pull-requests: write - id-token: write - -jobs: - claude-pr-assist: - if: | - github.event.issue.pull_request && - github.event.issue_comment.issue.state == 'open' && - ( - contains(github.event.comment.body, '@claude implement') || - contains(github.event.comment.body, '@claude fix') || - contains(github.event.comment.body, '@claude improve') || - contains(github.event.comment.body, '@claude update') || - contains(github.event.comment.body, '@claude refactor') || - contains(github.event.comment.body, '@claude help') - ) - runs-on: ubuntu-latest - - steps: - - name: Check user permissions - uses: actions/github-script@v7 - with: - script: | - if (context.actor !== 'bvdaakster') { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: 'āŒ **Access Denied**: Only bvdaakster can use Claude PR assistance.' - }); - throw new Error('Unauthorized user'); - } - - - name: Get PR details - id: pr-details - uses: actions/github-script@v7 - with: - script: | - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - return { - head_ref: pr.head.ref, - title: pr.title, - body: pr.body - }; - - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ fromJson(steps.pr-details.outputs.result).head_ref }} - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'npm' - - - name: Install pnpm - run: npm install -g pnpm@10.12.4 - - - name: Notify start - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `šŸ¤– **Claude PR Assistant Started**\n\nšŸ’¬ **Request**: ${{ github.event.comment.body }}\n🌿 **Branch**: \`${{ fromJson(steps.pr-details.outputs.result).head_ref }}\`\n\nWorking on your request...` - }); - - - name: Assist with Claude - uses: anthropics/claude-code-action@beta - with: - claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} - direct_prompt: | - You are assisting with a GitHub Pull Request. Please help with this request: - - **Pull Request #${{ github.event.issue.number }}**: ${{ fromJson(steps.pr-details.outputs.result).title }} - - **PR Description**: - ${{ fromJson(steps.pr-details.outputs.result).body }} - - **User Request**: - ${{ github.event.comment.body }} - - **Instructions**: - 1. Analyze the current PR changes and the user's request - 2. Implement the requested improvements, fixes, or changes - 3. Follow existing code patterns and conventions - 4. Use TypeScript with proper typing - 5. Follow ESM module structure with .js extensions - 6. Run quality checks if needed - - This is the @xtr-dev/payload-billing plugin for PayloadCMS. - Please implement the requested changes directly on this PR branch. - allowed_tools: "Bash(pnpm build),Bash(pnpm typecheck),Bash(pnpm lint),Bash(npm run test)" - - - name: Check for changes - id: changes - run: | - if git diff --quiet && git diff --cached --quiet; then - echo "has_changes=false" >> $GITHUB_OUTPUT - else - echo "has_changes=true" >> $GITHUB_OUTPUT - fi - - - name: Commit and push - if: steps.changes.outputs.has_changes == 'true' - run: | - git config --local user.email "action@github.com" - git config --local user.name "Claude PR Assistant" - git add . - git commit -m "feat: Claude PR assistance - ${{ github.event.comment.user.login }} request - - Request: ${{ github.event.comment.body }} - PR: #${{ github.event.issue.number }} - - šŸ¤– Generated with Claude PR Assistant - - Co-Authored-By: Claude " - git push origin ${{ fromJson(steps.pr-details.outputs.result).head_ref }} - - - name: Notify success - if: steps.changes.outputs.has_changes == 'true' - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `āœ… **PR Assistance Complete!**\n\nšŸ”§ **Changes Made**: Implemented your requested improvements\n🌿 **Branch**: \`${{ fromJson(steps.pr-details.outputs.result).head_ref }}\`\n\nChanges are ready for review! šŸš€` - }); - - - name: Handle no changes - if: steps.changes.outputs.has_changes == 'false' - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `ā„¹ļø **No Changes Needed**\n\nI analyzed your request but no code changes are required.` - }); - - - name: Handle failure - if: failure() - uses: actions/github-script@v7 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `āŒ **PR Assistance Failed**\n\nCheck the [workflow logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.` - }); \ No newline at end of file