|
| 1 | +name: Basic Memory Project Updates |
| 2 | + |
| 3 | +"on": |
| 4 | + pull_request: |
| 5 | + types: [closed] |
| 6 | + workflow_run: |
| 7 | + workflows: ["Deploy Production"] |
| 8 | + types: [completed] |
| 9 | + |
| 10 | +jobs: |
| 11 | + project-update: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + permissions: |
| 14 | + contents: read |
| 15 | + pull-requests: read |
| 16 | + issues: read |
| 17 | + actions: read |
| 18 | + steps: |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v6 |
| 21 | + |
| 22 | + - name: Set up Python |
| 23 | + uses: actions/setup-python@v6 |
| 24 | + with: |
| 25 | + python-version: "3.12" |
| 26 | + |
| 27 | + - name: Install Basic Memory |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + pip install basic-memory |
| 31 | +
|
| 32 | + - name: Collect project update context |
| 33 | + id: collect |
| 34 | + run: | |
| 35 | + bm ci collect \ |
| 36 | + --config .github/basic-memory/config.yml \ |
| 37 | + --output .github/basic-memory/project-update-context.json |
| 38 | +
|
| 39 | + - name: Stop when event is not eligible |
| 40 | + if: steps.collect.outputs.eligible != 'true' |
| 41 | + run: | |
| 42 | + echo "Auto BM skipped: ${{ steps.collect.outputs.skip_reason }}" |
| 43 | +
|
| 44 | + - name: Write Codex output schema |
| 45 | + if: steps.collect.outputs.eligible == 'true' |
| 46 | + run: | |
| 47 | + bm ci agent-schema --output "${{ runner.temp }}/agent-synthesis.schema.json" |
| 48 | +
|
| 49 | + - name: Synthesize project update with Codex |
| 50 | + if: steps.collect.outputs.eligible == 'true' |
| 51 | + uses: openai/codex-action@v1 |
| 52 | + with: |
| 53 | + openai-api-key: ${{ secrets.OPENAI_API_KEY }} |
| 54 | + prompt-file: .github/basic-memory/memory-ci-capture.md |
| 55 | + output-file: ${{ runner.temp }}/agent-synthesis.json |
| 56 | + output-schema-file: ${{ runner.temp }}/agent-synthesis.schema.json |
| 57 | + sandbox: read-only |
| 58 | + safety-strategy: drop-sudo |
| 59 | + |
| 60 | + - name: Publish project update |
| 61 | + if: steps.collect.outputs.eligible == 'true' |
| 62 | + env: |
| 63 | + BASIC_MEMORY_CLOUD_API_KEY: ${{ secrets.BASIC_MEMORY_API_KEY }} |
| 64 | + BASIC_MEMORY_CI_CLOUD_HOST: ${{ vars.BASIC_MEMORY_CLOUD_HOST }} |
| 65 | + run: | |
| 66 | + if [ -n "$BASIC_MEMORY_CI_CLOUD_HOST" ]; then |
| 67 | + export BASIC_MEMORY_CLOUD_HOST="$BASIC_MEMORY_CI_CLOUD_HOST" |
| 68 | + fi |
| 69 | + bm ci publish \ |
| 70 | + --cloud \ |
| 71 | + --config .github/basic-memory/config.yml \ |
| 72 | + --context .github/basic-memory/project-update-context.json \ |
| 73 | + --synthesis "${{ runner.temp }}/agent-synthesis.json" |
0 commit comments