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
48 changes: 48 additions & 0 deletions .github/workflows/codeboarding-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CodeBoarding sync

on:
push:
branches: ['main']
# Loop guard: don't re-trigger on the files this workflow itself commits.
# List generated files only: user-authored scope configuration must still trigger
# regeneration, while a merged sync PR must not trigger a loop.
paths-ignore:
- '.codeboarding/*.md'
- '.codeboarding/analysis.json'
- '.codeboarding/fingerprint.json'
- '.codeboarding/static_analysis.pkl'
- '.codeboarding/static_analysis.sha'
- '.codeboarding/codeboarding_version.json'
- '.codeboarding/health/health_report.json'
- 'docs/development/architecture.md'
workflow_dispatch:
inputs:
force_full:
description: 'Ignore the committed baseline and rebuild it from scratch (full analysis).'
type: boolean
required: false
default: false

permissions:
contents: write # commit the generated baseline + docs to the branch
id-token: write # identifies this repo to CodeBoarding's hosted tier, used by the free
# tier AND a license, and as the fallback until your own key exists

concurrency:
# Serialize against itself so a push landing mid-run can't make two commits.
group: codeboarding-sync
cancel-in-progress: false

jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: CodeBoarding/CodeBoarding-action@v1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pin both CodeBoarding action invocations

Replace @v1 here and in codeboarding.yml with the action's full 40-character commit SHA and retain the release tag as a comment. The mutable tag lets an upstream retag or compromise execute new code with contents: write and OIDC access on every main push; the review workflow similarly grants pull-request and issue write access.

AGENTS.md reference: AGENTS.md:L588-L588

Useful? React with 👍 / 👎.

with:
mode: sync
force_full: ${{ inputs.force_full || false }}
target_branch: 'main'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route protected-main syncs through a pull request

Configure sync_strategy: pull_request instead of targeting main with the default direct-push strategy, and grant pull-requests: write. This repository documents required checks and a merge queue on main in docs/decisions/0073-single-stable-branch-with-automatic-ports.md:51, so the workflow token cannot normally deliver its generated commit directly and the baseline will never update. CodeBoarding's protected-branch instructions prescribe the pull-request strategy for this case.

Useful? React with 👍 / 👎.

# CodeBoarding's free hosted tier. No secret to add: the run authenticates
# with the GitHub OIDC token that `id-token: write` above grants.
llm: hosted
38 changes: 38 additions & 0 deletions .github/workflows/codeboarding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CodeBoarding review

on:
pull_request:
types: [opened, reopened, closed, synchronize]
issue_comment:
types: [created]

# No workflow-level permissions: each job requests only what it needs (least
# privilege), so the default token starts with none.
permissions: {}

concurrency:
group: codeboarding-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }}

jobs:
review:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read # check out the repo + read the committed baseline (no writes in review mode)
pull-requests: write # post the architecture-diff PR comment
issues: write # the /codeboarding issue_comment trigger + comment API
id-token: write # mint a GitHub OIDC token for the free hosted tier (write is the only level for id-token)
actions: read # let a repeat review download the analysis an earlier run published, instead of re-deriving the whole PR
if: >
(github.event_name == 'pull_request' && github.event.action != 'closed' &&
github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null &&
startsWith(github.event.comment.body, '/codeboarding') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association))
steps:
- uses: CodeBoarding/CodeBoarding-action@v1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Require human review before publishing LLM comments

Do not let this action publish its hosted-LLM architecture analysis directly to pull requests. Every matching PR event currently generates and posts a comment without any contributor reviewing the output, contrary to the repository's explicit automated-agent policy; retain the analysis as an artifact or add a human approval and review stage before publication.

AGENTS.md reference: AGENTS.md:L84-L88

Useful? React with 👍 / 👎.

with:
# CodeBoarding's free hosted tier. No secret to add: the run authenticates
# with the GitHub OIDC token that `id-token: write` above grants.
llm: hosted
Loading