Skip to content

Commit a2dca5c

Browse files
vltbaudbotbaudbot-agentbenvinegar
authored
Add Notion integration for read-only workspace access (#182)
Co-authored-by: baudbot-agent <baudbot-agent@users.noreply.github.com> Co-authored-by: Ben Vinegar <ben@benv.ca>
1 parent 66cb52b commit a2dca5c

6 files changed

Lines changed: 826 additions & 4 deletions

File tree

.env.schema

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ SLACK_BROKER_DEDUPE_TTL_MS=1200000
182182
# @docs(https://linear.app/settings/api)
183183
LINEAR_API_KEY=
184184

185+
# ── Notion (optional) ────────────────────────────────────────────────────────
186+
187+
# Notion integration secret (internal integration token)
188+
# @type=string
189+
# @docs(https://www.notion.so/my-integrations)
190+
NOTION_API_KEY=
191+
185192
# ── Tool Guard ───────────────────────────────────────────────────────────────
186193

187194
# Unix username of the agent

.github/workflows/integration.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,29 @@ jobs:
7676
steps:
7777
- uses: actions/checkout@v4
7878

79+
- name: Gate external fork PRs
80+
id: gate
81+
shell: bash
82+
run: |
83+
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
84+
echo "enabled=false" >> "$GITHUB_OUTPUT"
85+
else
86+
echo "enabled=true" >> "$GITHUB_OUTPUT"
87+
fi
88+
89+
- name: Skip integration for external fork PRs
90+
if: steps.gate.outputs.enabled != 'true'
91+
run: |
92+
echo "Skipping droplet integration for external fork pull requests (secrets are unavailable)."
93+
7994
- name: Generate ephemeral SSH key
95+
if: steps.gate.outputs.enabled == 'true'
8096
run: |
8197
mkdir -p ~/.ssh
8298
ssh-keygen -t ed25519 -f ~/.ssh/ci_key -N "" -q
8399
84100
- name: Create droplet
101+
if: steps.gate.outputs.enabled == 'true'
85102
id: droplet
86103
env:
87104
DO_API_TOKEN: ${{ secrets.DO_API_TOKEN }}
@@ -94,6 +111,7 @@ jobs:
94111
echo "$output"
95112
96113
- name: Wait for SSH
114+
if: steps.gate.outputs.enabled == 'true'
97115
env:
98116
DO_API_TOKEN: ${{ secrets.DO_API_TOKEN }}
99117
run: |
@@ -102,6 +120,7 @@ jobs:
102120
~/.ssh/ci_key
103121
104122
- name: Upload source
123+
if: steps.gate.outputs.enabled == 'true'
105124
run: |
106125
tar czf /tmp/baudbot-src.tar.gz \
107126
--exclude=node_modules --exclude=.git .
@@ -111,6 +130,7 @@ jobs:
111130
"root@${{ steps.droplet.outputs.DROPLET_IP }}:/tmp/baudbot-src.tar.gz"
112131
113132
- name: Setup and test
133+
if: steps.gate.outputs.enabled == 'true'
114134
run: |
115135
bash bin/ci/droplet.sh run \
116136
"${{ steps.droplet.outputs.DROPLET_IP }}" \
@@ -119,7 +139,7 @@ jobs:
119139
"CI_ANTHROPIC_API_KEY=${{ secrets.CI_ANTHROPIC_API_KEY }}"
120140
121141
- name: Cleanup
122-
if: always()
142+
if: always() && steps.gate.outputs.enabled == 'true'
123143
env:
124144
DO_API_TOKEN: ${{ secrets.DO_API_TOKEN }}
125145
run: |

CONFIGURATION.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ The `linear` extension provides a tool for interacting with the Linear issue tra
8484
|----------|-------------|---------------|
8585
| `LINEAR_API_KEY` | Linear API key (personal or OAuth token) | Go to [Linear Settings → API](https://linear.app/settings/api), create a **Personal API key**. For workspace-wide access, create an OAuth application instead. The key needs read/write access to issues and comments. |
8686

87+
### Notion Integration
88+
89+
The `notion` extension provides a read-only tool for accessing your Notion workspace. The agent can search for pages and databases, retrieve full page content (including nested blocks), query database entries, and inspect database schemas.
90+
91+
| Variable | Description | How to get it |
92+
|----------|-------------|---------------|
93+
| `NOTION_API_KEY` | Notion integration secret (internal integration token) | Go to [Notion → My integrations](https://www.notion.so/my-integrations), create a new **Internal Integration**. Copy the **Internal Integration Token** (starts with `secret_`). After creating the integration, share the pages/databases you want the agent to access by clicking **"•••"****Add connections** → select your integration. The integration can only read content explicitly shared with it. |
94+
95+
**Capabilities:**
96+
- `search` — Find pages and databases by text query or type filter
97+
- `get` — Read full page content with all blocks (paragraphs, headings, lists, code, callouts, etc.)
98+
- `list` — Query database entries with filters and sorting
99+
- `database` — Inspect database schema and property types
100+
101+
**Permissions:**
102+
The integration token only provides read access to pages/databases explicitly shared with the integration. It cannot create, update, or delete content.
103+
87104
### Slack Channels
88105

89106
| Variable | Description | How to get it |

0 commit comments

Comments
 (0)