Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/goose-pr-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Goose

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:

permissions:
contents: write
pull-requests: write
issues: write

env:
PROVIDER_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ github.token }}

jobs:
goose-comment:
name: Goose Comment
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Gather PR information
run: |
{
echo "# Files Changed"
gh pr view "$PR_NUMBER" --json files \
-q '.files[] | "* " + .path + " (" + (.additions|tostring) + " additions, " + (.deletions|tostring) + " deletions)"'
echo ""
echo "# Changes Summary"
gh pr diff "$PR_NUMBER"
} > changes.txt

- name: Install Goose CLI
run: |
mkdir -p /home/runner/.local/bin
curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh \
| CONFIGURE=false INSTALL_PATH=/home/runner/.local/bin bash
echo "/home/runner/.local/bin" >> "$GITHUB_PATH"

- name: Configure Goose
run: |
mkdir -p ~/.config/goose
cat > ~/.config/goose/config.yaml <<'EOF'
GOOSE_PROVIDER: google
GOOSE_MODEL: gemini-2.0-flash-exp
keyring: false
EOF

- name: Create instructions for Goose
run: |
cat > instructions.txt <<'EOF'
Create a summary of the changes provided. Don't provide any session or logging details.
The summary for each file should be brief and structured as:
<filename/path (wrapped in backticks)>
- dot points of changes
You don't need any extensions, don't mention extensions at all.
The changes to summarise are:
EOF
cat changes.txt >> instructions.txt

- name: Test
run: cat instructions.txt

- name: Run Goose and filter output
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
run: |
goose run --instructions instructions.txt \
| sed -E 's/\x1B\[[0-9;]*[mK]//g' \
| grep -v "logging to /home/runner/.config/goose/sessions/" \
| grep -v "^starting session" \
| grep -v "^Closing session" \
| sed 's/[[:space:]]*$//' \
> pr_comment.txt

- name: Post comment to PR
run: |
cat -A pr_comment.txt
gh pr comment "$PR_NUMBER" --body-file pr_comment.txt
186 changes: 0 additions & 186 deletions .github/workflows/goose.yml

This file was deleted.

15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
tech-stack-advisor:
build: .
ports:
- "7860:7860"
environment:
- ENV=production
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:7860', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped

Loading