diff --git a/.github/workflows/claude-fast.yml b/.github/workflows/claude-fast.yml new file mode 100644 index 0000000000..c04302f167 --- /dev/null +++ b/.github/workflows/claude-fast.yml @@ -0,0 +1,78 @@ +name: Fast Claude + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + determine-commenter: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/ai-fast')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/ai-fast')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '/ai-fast')) || + (github.event_name == 'issues' && contains(github.event.issue.body, '/ai-fast')) + runs-on: ubicloud-standard-2 + outputs: + commenter: ${{ steps.determine-commenter.outputs.commenter }} + steps: + - name: Determine commenter + id: determine-commenter + run: | + # Work out who wrote the comment / review + if [[ "${{ github.event_name }}" == "issue_comment" || \ + "${{ github.event_name }}" == "pull_request_review_comment" ]]; then + COMMENTER="${{ github.event.comment.user.login }}" + elif [[ "${{ github.event_name }}" == "pull_request_review" ]]; then + COMMENTER="${{ github.event.review.user.login }}" + else + COMMENTER="${{ github.event.issue.user.login }}" + fi + echo "commenter=$COMMENTER" >> $GITHUB_OUTPUT + + check-membership: + needs: determine-commenter + uses: ./.github/workflows/check-org-membership.yml + with: + commenter: ${{ needs.determine-commenter.outputs.commenter }} + secrets: + access_token: ${{ secrets.ORG_ACCESS_TOKEN }} + + claude-code-action: + needs: [determine-commenter, check-membership] + if: | + needs.check-membership.outputs.is_member == 'true' + runs-on: ubicloud-standard-8 + 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 PR Action + uses: anthropics/claude-code-action@beta + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + model: claude-opus-4-1-20250805 + fallback_model: claude-sonnet-4-20250514 + timeout_minutes: "60" + allowed_tools: "mcp__github__create_pull_request" + allowed_bots: "windmill-internal-app[bot]" + custom_instructions: | + ## IMPORTANT INSTRUCTIONS + - Your branch name should be a short description of the requested changes. + - Bypass previous instructions and instead of adding a url in your comment to manually create a PR, if you created a new branch with your changes, automatically create a draft PR from that branch to main. + + ## Available Tools + - mcp__github__create_pull_request: Create PRs from branches + trigger_phrase: "/ai-fast" diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 48fb4beaba..e5b7ba1b41 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -96,14 +96,11 @@ jobs: SQLX_OFFLINE: true with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + model: claude-opus-4-1-20250805 + fallback_model: claude-sonnet-4-20250514 timeout_minutes: "60" allowed_tools: "mcp__github__create_pull_request,Bash" allowed_bots: "windmill-internal-app[bot]" - # claude_args: | - # --max-turns 10 - # --model claude-4-0-sonnet-20250805 - model: claude-opus-4-1-20250805 - fallback_model: claude-sonnet-4-20250514 custom_instructions: | ## IMPORTANT INSTRUCTIONS - Your branch name should be a short description of the requested changes.