Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .github/workflows/neon_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Create/Delete Branch for Pull Request

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Comment on lines +1 to +12

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is described as documentation/copy updates, but it also adds a new GitHub Actions workflow that creates/deletes Neon branches and runs migrations. Please update the PR description/title to include this operational change (or split the workflow into a separate PR) so reviewers can assess the workflow/security implications explicitly.

Copilot uses AI. Check for mistakes.

jobs:
setup:
name: Setup
outputs:
branch: ${{ steps.branch_name.outputs.current_branch }}
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: branch_name
uses: tj-actions/branch-names@v8

create_neon_branch:
name: Create Neon Branch
permissions:
contents: read
outputs:
db_url: ${{ steps.create_neon_branch.outputs.db_url }}
db_url_pooled: ${{ steps.create_neon_branch.outputs.db_url_pooled }}
needs: setup
if: |
github.event_name == 'pull_request' && (
github.event.action == 'synchronize'
|| github.event.action == 'opened'
|| github.event.action == 'reopened')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get branch expiration date as an env variable (2 weeks from now)
id: get_expiration_date
run: echo "EXPIRES_AT=$(date -u --date '+14 days' +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_ENV"

- name: Create Neon Branch
id: create_neon_branch
uses: neondatabase/create-branch-action@v6
with:
project_id: ${{ vars.NEON_PROJECT_ID }}
branch_name: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
api_key: ${{ secrets.NEON_API_KEY }}
expires_at: ${{ env.EXPIRES_AT }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn

- name: Enable Corepack (Yarn from packageManager)
run: corepack enable

- name: Install dependencies
run: yarn install --immutable

# The step above creates a new Neon branch.
# You may want to do something with the new branch, such as run migrations, run tests
# on it, or send the connection details to a hosting platform environment.
# The branch DATABASE_URL is available to you via:
# "${{ steps.create_neon_branch.outputs.db_url_pooled }}".
# It's important you don't log the DATABASE_URL as output as it contains a username and
# password for your database.
- name: Run Migrations
run: yarn db:push
env:
# to use pooled connection
#DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url_pooled }}"
# OR to use unpooled connection
DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url }}"

Comment on lines +39 to +82

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Run Migrations step runs npm run db:migrate but this job never checks out the repo or installs dependencies / sets up Node. On a fresh runner this will fail because package.json (and node_modules) won't be present. Add actions/checkout, actions/setup-node + Corepack, install deps (e.g. yarn install --immutable), then run the migrate script (prefer yarn db:migrate to match the repo CI workflow).

Copilot uses AI. Check for mistakes.
# Following the step above, which runs database migrations, you may want to check
# for schema changes in your database. We recommend using the following action to
# post a comment to your pull request with the schema diff. For this action to work,
# you also need to give permissions to the workflow job to be able to post comments
# and read your repository contents. Add the following permissions to the workflow job:
#
# permissions:
# contents: read
# pull-requests: write
#
# You can also check out https://github.com/neondatabase/schema-diff-action for more
# information on how to use the schema diff action.
# You can uncomment the lines below to enable the schema diff action.
# - name: Post Schema Diff Comment to PR
# uses: neondatabase/schema-diff-action@v1
# with:
# project_id: ${{ vars.NEON_PROJECT_ID }}
# compare_branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
# api_key: ${{ secrets.NEON_API_KEY }}

delete_neon_branch:
name: Delete Neon Branch
needs: setup
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Delete Neon Branch
uses: neondatabase/delete-branch-action@v3
with:
project_id: ${{ vars.NEON_PROJECT_ID }}
branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
api_key: ${{ secrets.NEON_API_KEY }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ flowchart LR
subgraph internet ["☁️ Public Internet"]
P["Provider\nGitHub · Stripe · Slack"]
C["clawproxy\n(public endpoint)"]
Q[("Durable\nqueue")]
Q[("Safe\nstorage")]
end

subgraph private ["🔒 Your Private Network"]
Expand All @@ -34,7 +34,7 @@ flowchart LR
```

1. **A provider** (GitHub, Stripe, Slack, …) sends a webhook to your public clawproxy URL.
2. **clawproxy** accepts the request, validates it, and persists the event to a durable queue.
2. **clawproxy** accepts the request, validates it, and stores the event safely until your node connects.
3. **Your OpenClaw node** — running behind NAT or a private LAN — connects to clawproxy over an outbound connection, receives queued events, processes them locally, and acknowledges delivery.

Your private node never needs an open port or firewall rule.
Expand Down
4 changes: 2 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default function Home() {
},
{
title: 'Ingress accepted',
body: 'Request validated and persisted to the durable queue.',
body: 'Validated and saved safely until delivery to your node.',
},
{
title: 'Live push or pull',
Expand Down Expand Up @@ -197,7 +197,7 @@ export default function Home() {
</div>
<div className="border-border bg-card/50 rounded-2xl border p-4">
<p className="text-muted-foreground text-xs tracking-[0.24em] uppercase">Storage</p>
<p className="mt-2 text-lg font-semibold">Durable queue</p>
<p className="mt-2 text-lg font-semibold">Safe until delivery</p>
</div>
<div className="border-border bg-card/50 rounded-2xl border p-4">
<p className="text-muted-foreground text-xs tracking-[0.24em] uppercase">Ideal for</p>
Expand Down
2 changes: 1 addition & 1 deletion components/app/architecture-diagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function ArchitectureDiagram() {
accent
label="clawproxy"
sublabel="Public cloud"
items={['Accepts & validates', 'Stores in durable queue', 'Manages delivery state']}
items={['Accepts & validates', 'Saves events until delivery', 'Manages delivery state']}
/>

<ArrowRight topLabel="outbound pull" bottomLabel="events + ack" />
Expand Down
Loading