-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
142 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Aider Issue Fix | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
issue_number: | ||
description: 'Issue number to fix' | ||
required: true | ||
type: string | ||
model: | ||
description: 'Model to use' | ||
required: false | ||
type: string | ||
default: 'claude-3-5-sonnet-20241022' | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
issues: read | ||
|
||
jobs: | ||
aider-fix: | ||
runs-on: ubuntu-latest | ||
if: github.actor == 'zachmayer' | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::lintr, local::. | ||
needs: lint | ||
|
||
- name: Install Package | ||
run: make install | ||
|
||
- name: Get Issue Content | ||
id: get-issue | ||
uses: actions-cool/issues-helper@v3 | ||
with: | ||
actions: 'get-issue' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.inputs.issue_number }} | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Aider | ||
run: pip install -U aider-chat | ||
|
||
- name: Prepare Instructions | ||
run: | | ||
echo "${{ steps.get-issue.outputs.issue-body }}" > issue.md | ||
cat aider-instructions.md issue.md > combined_instructions.md | ||
- name: Run Aider | ||
run: | | ||
aider \ | ||
--model anthropic/${{ github.event.inputs.model }} \ | ||
--no-analytics \ | ||
--yes-always \ | ||
--verbose \ | ||
--lint-cmd "make fix-style lint" \ | ||
--test-cmd "make test" \ | ||
--message-file combined_instructions.md \ | ||
--auto-commits | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "fix: Automated fixes for issue #${{ github.event.inputs.issue_number }}" | ||
branch: aider-fix-issue-${{ github.event.inputs.issue_number }} | ||
delete-branch: true | ||
title: "fix: Automated fixes for issue #${{ github.event.inputs.issue_number }}" | ||
body: | | ||
This PR contains automated fixes for issue #${{ github.event.inputs.issue_number }} using aider. | ||
Original issue: ${{ steps.get-issue.outputs.issue-title }} |
This file was deleted.
Oops, something went wrong.