From 2264ca0232c31832956e7aced53bfd2dcee9db54 Mon Sep 17 00:00:00 2001 From: "Anaz S. Aji" Date: Sat, 13 Jun 2026 20:58:50 +0700 Subject: [PATCH 1/5] ci: add project board auto-sync workflow (#173) --- .github/workflows/project-sync.yml | 74 ++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/project-sync.yml diff --git a/.github/workflows/project-sync.yml b/.github/workflows/project-sync.yml new file mode 100644 index 0000000..29d641a --- /dev/null +++ b/.github/workflows/project-sync.yml @@ -0,0 +1,74 @@ +name: Sync to CodeCorraDev Roadmap + +on: + issues: + types: [opened, reopened, closed, labeled] + # Manual trigger for backfill + workflow_dispatch: + +permissions: + issues: read + repository-projects: read + +env: + PROJECT_TOKEN: ${{ secrets.PROJECT_BOARD_TOKEN }} + PROJECT_NODE_ID: ${{ secrets.PROJECT_NODE_ID }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Sync issue to Project Board + env: + GH_TOKEN: ${{ secrets.PROJECT_BOARD_TOKEN }} + run: | + EVENT="${{ github.event.action }}" + ISSUE_NUMBER="${{ github.event.issue.number }}" + ISSUE_NODE_ID="${{ github.event.issue.node_id }}" + ISSUE_STATE="${{ github.event.issue.state }}" + REPO="${{ github.repository }}" + + echo "::group::Event Details" + echo "Event: $EVENT" + echo "Issue: #$ISSUE_NUMBER" + echo "State: $ISSUE_STATE" + echo "Repo: $REPO" + echo "Project: $PROJECT_NODE_ID" + echo "::endgroup::" + + if [ -z "$PROJECT_NODE_ID" ] || [ "$PROJECT_NODE_ID" = "" ]; then + echo "::warning::PROJECT_NODE_ID not set. Skipping." + exit 0 + fi + + add_to_project() { + local node_id="$1" + RESULT=$(gh api graphql \ + -f query=" + mutation { + addProjectV2ItemById(input: {projectId: \"$PROJECT_NODE_ID\", contentId: \"$node_id\"}) { + item { id } + } + }" 2>&1) + if echo "$RESULT" | grep -q '"item"'; then + echo "✅ Added to project" + else + echo "⚠️ Add failed (may already exist): $RESULT" + fi + } + + case "$EVENT" in + opened|reopened) + if [ "$ISSUE_STATE" = "open" ]; then + echo "Adding opened/reopened issue #$ISSUE_NUMBER..." + add_to_project "$ISSUE_NODE_ID" + fi + ;; + closed) + echo "Issue #$ISSUE_NUMBER closed — item stays in board (visibility handled by project)" + ;; + labeled) + echo "Issue #$ISSUE_NUMBER labeled — no action needed" + ;; + esac From 1370eb4b467c24b7300440cda079d15a420f8ac8 Mon Sep 17 00:00:00 2001 From: "Anaz S. Aji" Date: Sun, 14 Jun 2026 18:45:05 +0700 Subject: [PATCH 2/5] chore: set base to /docs/trapfall/ for unified routing --- docs/.vitepress/config.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index cc37283..aedb51f 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -4,29 +4,32 @@ export default defineConfig({ title: 'TrapFall', description: 'Lightweight self-hosted error capture engine', lang: 'en-US', + base: '/docs/trapfall/', cleanUrls: true, - head: [['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }]], + head: [['link', { rel: 'icon', type: 'image/svg+xml', href: '/docs/trapfall/logo.svg' }]], themeConfig: { nav: [ - { text: 'Guide', link: '/guide/getting-started' }, - { text: 'Config', link: '/guide/configuration' }, - { text: 'API', link: '/guide/api' }, + { text: 'Codecora', link: 'https://codecora.dev' }, + { text: 'Guide', link: '/docs/trapfall/guide/getting-started' }, + { text: 'Config', link: '/docs/trapfall/guide/configuration' }, + { text: 'API', link: '/docs/trapfall/guide/api' }, + { text: 'GitHub', link: 'https://github.com/codecoradev/trapfall' }, ], sidebar: [ { text: 'Guide', items: [ - { text: 'Getting Started', link: '/guide/getting-started' }, - { text: 'Configuration', link: '/guide/configuration' }, - { text: 'Multi-Project', link: '/guide/multi-project' }, - { text: 'SDK Integration', link: '/guide/sdk-integration' }, - { text: 'Docker', link: '/guide/docker' }, - { text: 'CLI Reference', link: '/guide/cli' }, - { text: 'API Reference', link: '/guide/api' }, - { text: 'Alert Rules', link: '/guide/alerts' }, - { text: 'Search', link: '/guide/search' }, - { text: 'Security', link: '/guide/security' }, - { text: 'MCP Server', link: '/guide/mcp' }, + { text: 'Getting Started', link: '/docs/trapfall/guide/getting-started' }, + { text: 'Configuration', link: '/docs/trapfall/guide/configuration' }, + { text: 'Multi-Project', link: '/docs/trapfall/guide/multi-project' }, + { text: 'SDK Integration', link: '/docs/trapfall/guide/sdk-integration' }, + { text: 'Docker', link: '/docs/trapfall/guide/docker' }, + { text: 'CLI Reference', link: '/docs/trapfall/guide/cli' }, + { text: 'API Reference', link: '/docs/trapfall/guide/api' }, + { text: 'Alert Rules', link: '/docs/trapfall/guide/alerts' }, + { text: 'Search', link: '/docs/trapfall/guide/search' }, + { text: 'Security', link: '/docs/trapfall/guide/security' }, + { text: 'MCP Server', link: '/docs/trapfall/guide/mcp' }, ], }, ], From 7e3bf2c4e70d259e77f685f5716a3eda719b3a57 Mon Sep 17 00:00:00 2001 From: "Anaz S. Aji" Date: Sun, 14 Jun 2026 18:45:38 +0700 Subject: [PATCH 3/5] ci: add CF Pages deploy workflow --- .github/workflows/deploy-website.yml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/deploy-website.yml diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml new file mode 100644 index 0000000..c1f4478 --- /dev/null +++ b/.github/workflows/deploy-website.yml @@ -0,0 +1,55 @@ +name: Deploy Website to Cloudflare Pages + +on: + push: + branches: [main] + paths: + - 'docs/**' + - '.github/workflows/deploy-website.yml' + workflow_dispatch: + +concurrency: + group: deploy-website + cancel-in-progress: false + +permissions: + contents: read + deployments: write + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm + cache-dependency-path: docs/package-lock.json + + - name: Install dependencies + run: npm ci + working-directory: docs + + - name: Build + run: npm run build + working-directory: docs + + - name: Verify build output + run: | + if [ ! -d "docs/.vitepress/dist" ] || [ -z "$(ls -A docs/.vitepress/dist)" ]; then + echo "::error::Build output is empty or missing." + exit 1 + fi + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v4 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + preCommands: npx wrangler pages project create trapfall --production-branch=main || true + command: pages deploy docs/.vitepress/dist/ --project-name=trapfall --commit-dirty=true --branch=main From fc3b65bd90729a76a6ede794bbf6f2395bc46527 Mon Sep 17 00:00:00 2001 From: "Anaz S. Aji" Date: Sun, 14 Jun 2026 18:57:54 +0700 Subject: [PATCH 4/5] fix: remove double base prefix in links --- docs/.vitepress/config.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index aedb51f..e0735c3 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -6,30 +6,30 @@ export default defineConfig({ lang: 'en-US', base: '/docs/trapfall/', cleanUrls: true, - head: [['link', { rel: 'icon', type: 'image/svg+xml', href: '/docs/trapfall/logo.svg' }]], + head: [['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }]], themeConfig: { nav: [ { text: 'Codecora', link: 'https://codecora.dev' }, - { text: 'Guide', link: '/docs/trapfall/guide/getting-started' }, - { text: 'Config', link: '/docs/trapfall/guide/configuration' }, - { text: 'API', link: '/docs/trapfall/guide/api' }, + { text: 'Guide', link: '/guide/getting-started' }, + { text: 'Config', link: '/guide/configuration' }, + { text: 'API', link: '/guide/api' }, { text: 'GitHub', link: 'https://github.com/codecoradev/trapfall' }, ], sidebar: [ { text: 'Guide', items: [ - { text: 'Getting Started', link: '/docs/trapfall/guide/getting-started' }, - { text: 'Configuration', link: '/docs/trapfall/guide/configuration' }, - { text: 'Multi-Project', link: '/docs/trapfall/guide/multi-project' }, - { text: 'SDK Integration', link: '/docs/trapfall/guide/sdk-integration' }, - { text: 'Docker', link: '/docs/trapfall/guide/docker' }, - { text: 'CLI Reference', link: '/docs/trapfall/guide/cli' }, - { text: 'API Reference', link: '/docs/trapfall/guide/api' }, - { text: 'Alert Rules', link: '/docs/trapfall/guide/alerts' }, - { text: 'Search', link: '/docs/trapfall/guide/search' }, - { text: 'Security', link: '/docs/trapfall/guide/security' }, - { text: 'MCP Server', link: '/docs/trapfall/guide/mcp' }, + { text: 'Getting Started', link: '/guide/getting-started' }, + { text: 'Configuration', link: '/guide/configuration' }, + { text: 'Multi-Project', link: '/guide/multi-project' }, + { text: 'SDK Integration', link: '/guide/sdk-integration' }, + { text: 'Docker', link: '/guide/docker' }, + { text: 'CLI Reference', link: '/guide/cli' }, + { text: 'API Reference', link: '/guide/api' }, + { text: 'Alert Rules', link: '/guide/alerts' }, + { text: 'Search', link: '/guide/search' }, + { text: 'Security', link: '/guide/security' }, + { text: 'MCP Server', link: '/guide/mcp' }, ], }, ], From f739048aa24149bf49f4ab70d2029f57e42896ea Mon Sep 17 00:00:00 2001 From: "Anaz S. Aji" Date: Sun, 14 Jun 2026 19:26:38 +0700 Subject: [PATCH 5/5] fix(ci): deploy to CF Pages production (remove --branch flag) (#175) --- .github/workflows/deploy-website.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index c1f4478..1e72440 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -52,4 +52,4 @@ jobs: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} preCommands: npx wrangler pages project create trapfall --production-branch=main || true - command: pages deploy docs/.vitepress/dist/ --project-name=trapfall --commit-dirty=true --branch=main + command: pages deploy docs/.vitepress/dist/ --project-name=trapfall --commit-dirty=true