Skip to content

Fix/nested workspace detection #249

Fix/nested workspace detection

Fix/nested workspace detection #249

name: Build and Commit Binaries
permissions:
contents: write
pull-requests: write
on:
pull_request:
branches:
- main
- dev
- 'feat/**'
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- 'cmd/**'
- 'internal/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Run tests
run: go test ./...
- name: Build binaries
run: |
echo "Building rag-code-mcp..."
go build -o bin/rag-code-mcp ./cmd/rag-code-mcp
echo "Building rag-code-install..."
go build -o bin/rag-code-install ./cmd/rag-code-install
chmod +x bin/*
- name: Check if binaries changed
id: check_changes
run: |
git add -f bin/
if git diff --cached --quiet; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Create pull request with updated binaries (main only)
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main' && steps.check_changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "chore: update binaries"
body: "Auto-generated PR to update binaries after code changes."
branch: "chore/update-binaries/pr-${{ github.event.pull_request.number }}"
base: ${{ github.event.pull_request.base.ref }}
delete-branch: true