CI/CD pipeline #1064
Closed
ayush-aditya-scopely
started this conversation in
General
CI/CD pipeline
#1064
Replies: 2 comments
-
Yes - you can use Goose in CI/CD pipelines. For example, here's a Discord user running Goose in a GitHub Actions workflow. |
Beta Was this translation helpful? Give feedback.
0 replies
-
the example below shows a github action workflow with Databricks provider, but you can configure OpenAI, Anthropic, etc. using env variables. name: Goose
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
permissions:
contents: write
pull-requests: write
issues: write
env:
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
jobs:
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 <<EOF > ~/.config/goose/config.yaml
GOOSE_PROVIDER: databricks
GOOSE_MODEL: claude-3-5-sonnet-latest
DATABRICKS_HOST: REPLACE_WITH_YOUR_PROVIDER_CONFIG
keyring: false
EOF
- name: Create instructions for Goose
run: |
cat <<EOF > instructions.txt
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:
$(cat changes.txt)
EOF
- name: Test
run: cat instructions.txt
- name: Run Goose and filter output
run: |
goose run --instructions instructions.txt | \
# Remove ANSI color codes
sed -E 's/\x1B\[[0-9;]*[mK]//g' | \
# Remove session/logging lines
grep -v "logging to /home/runner/.config/goose/sessions/" | \
grep -v "^starting session" | \
grep -v "^Closing session" | \
# Trim trailing whitespace
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
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
with i can ask it go through CI/CD pipeline and ask it do stuff on that pipeline can it do it ?
Beta Was this translation helpful? Give feedback.
All reactions