From 61677e0425eabd1363ca380390f1c05f9c9484d8 Mon Sep 17 00:00:00 2001 From: josix Date: Sat, 21 Dec 2024 02:02:15 +0800 Subject: [PATCH] ci: Add GitHub workflow for thought consolidation and processing --- .github/workflows/thought-consolidation.yml | 56 +++++++++++++++++++++ random-thoughts/2024-12-21.md | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/thought-consolidation.yml diff --git a/.github/workflows/thought-consolidation.yml b/.github/workflows/thought-consolidation.yml new file mode 100644 index 0000000..e2a4bae --- /dev/null +++ b/.github/workflows/thought-consolidation.yml @@ -0,0 +1,56 @@ +name: Thought Consolidation + +on: + workflow_dispatch: + +jobs: + consolidate-thoughts: + runs-on: ubuntu-latest + permissions: + contents: write # Needed for pushing changes + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Get full history for comparing changes + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pipx + pipx install aider-chat + + - name: Configure Git + run: | + git config --global user.name 'GitHub Action Bot' + git config --global user.email 'action@github.com' + + - name: Process thoughts + env: + AIDER_ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + run: | + gd --name-only HEAD HEAD^ | xargs cat > all_thoughts.md + cat random-thoughts/aider-brain/*.md >> all_thoughts.md + aider --auto-commits --sonnet --architect --read all_thoughts.md --message "Consider the read-only files and identify if the thoughts are matched in the random-thoughts/aider-brain/*.md, for each identified topic: 1. ff yes, consolidate and expand the thoughts into detailed content 2. If no, create a new file in the random-thoughts/aider-brain" --yes + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3 + with: + commit-message: 'Consolidate thoughts from aider itself' + branch: i-am-aider + title: 'Aider: Consolidate thoughts' + body: | + Aider has consolidated the thoughts from the random-thoughts/aider-brain/*.md files and the latest commit. + labels: | + automation + + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/random-thoughts/2024-12-21.md b/random-thoughts/2024-12-21.md index a38cb52..bdf6a12 100644 --- a/random-thoughts/2024-12-21.md +++ b/random-thoughts/2024-12-21.md @@ -574,7 +574,7 @@ tags: Fetcher-->>Consumer: ConsumerRecords deactivate Fetcher - ``` + ``` Detailed Explanation: