Skip to content

Commit 2a43e2e

Browse files
Merge pull request #1 from CodeBoarding/codeboarding/setup-action
Add CodeBoarding architecture analysis
2 parents 17d9eba + 5db8fb9 commit 2a43e2e

2 files changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CodeBoarding sync
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
# Loop guard: don't re-trigger on the files this workflow itself commits.
7+
# List generated files only: user-authored scope configuration must still trigger
8+
# regeneration, while a merged sync PR must not trigger a loop.
9+
paths-ignore:
10+
- '.codeboarding/*.md'
11+
- '.codeboarding/analysis.json'
12+
- '.codeboarding/fingerprint.json'
13+
- '.codeboarding/static_analysis.pkl'
14+
- '.codeboarding/static_analysis.sha'
15+
- '.codeboarding/codeboarding_version.json'
16+
- '.codeboarding/health/health_report.json'
17+
- 'docs/development/architecture.md'
18+
workflow_dispatch:
19+
inputs:
20+
force_full:
21+
description: 'Ignore the committed baseline and rebuild it from scratch (full analysis).'
22+
type: boolean
23+
required: false
24+
default: false
25+
26+
permissions:
27+
contents: write # commit the generated baseline + docs to the branch
28+
id-token: write # identifies this repo to CodeBoarding's hosted tier, used by the free
29+
# tier AND a license, and as the fallback until your own key exists
30+
31+
concurrency:
32+
# Serialize against itself so a push landing mid-run can't make two commits.
33+
group: codeboarding-sync
34+
cancel-in-progress: false
35+
36+
jobs:
37+
sync:
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 60
40+
steps:
41+
- uses: CodeBoarding/CodeBoarding-action@v1
42+
with:
43+
mode: sync
44+
force_full: ${{ inputs.force_full || false }}
45+
target_branch: 'main'
46+
# Free tier needs no secret; these fall through to the hosted OIDC tier when
47+
# unset. Add either repo secret (Settings → Secrets and variables → Actions)
48+
# for more/unmetered usage; no YAML edit required.
49+
llm_api_key: ${{ secrets.OPENROUTER_API_KEY }} # BYO LLM provider key (OpenRouter)
50+
license_key: ${{ secrets.CODEBOARDING_LICENSE }} # CodeBoarding paid plan

.github/workflows/codeboarding.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CodeBoarding review
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, ready_for_review, closed, synchronize]
6+
issue_comment:
7+
types: [created]
8+
9+
# No workflow-level permissions: each job requests only what it needs (least
10+
# privilege), so the default token starts with none.
11+
permissions: {}
12+
13+
concurrency:
14+
group: codeboarding-${{ github.event.pull_request.number || github.event.issue.number }}
15+
cancel-in-progress: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }}
16+
17+
jobs:
18+
review:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 60
21+
permissions:
22+
contents: read # check out the repo + read the committed baseline (no writes in review mode)
23+
pull-requests: write # post the architecture-diff PR comment
24+
issues: write # the /codeboarding issue_comment trigger + comment API
25+
id-token: write # mint a GitHub OIDC token for the free hosted tier (write is the only level for id-token)
26+
if: >
27+
(github.event_name == 'pull_request' && github.event.action != 'closed' &&
28+
github.event.pull_request.draft == false &&
29+
github.event.pull_request.head.repo.full_name == github.repository) ||
30+
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null &&
31+
startsWith(github.event.comment.body, '/codeboarding') &&
32+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
33+
steps:
34+
- uses: CodeBoarding/CodeBoarding-action@v1
35+
with:
36+
# Free tier needs no secret; these fall through to the hosted OIDC tier when
37+
# unset. Add either repo secret (Settings → Secrets and variables → Actions)
38+
# for more/unmetered usage; no YAML edit required.
39+
llm_api_key: ${{ secrets.OPENROUTER_API_KEY }} # BYO LLM provider key (OpenRouter)
40+
license_key: ${{ secrets.CODEBOARDING_LICENSE }} # CodeBoarding paid plan

0 commit comments

Comments
 (0)