Repository navigation
Add CodeBoarding architecture analysis #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: CodeBoarding | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, closed, synchronize] | ||
| issue_comment: | ||
| types: [created] | ||
| push: | ||
| branches: ['main'] | ||
| # Loop guard: sync commits these to main. Generated files only, so an edit to | ||
| # the user-authored configuration under .codeboarding/ still triggers a sync. | ||
| paths-ignore: | ||
| - '.codeboarding/analysis.json' | ||
| - '.codeboarding/fingerprint.json' | ||
| - '.codeboarding/static_analysis.pkl' | ||
| - '.codeboarding/static_analysis.sha' | ||
| - '.codeboarding/codeboarding_version.json' | ||
| - '.codeboarding/health/health_report.json' | ||
| workflow_dispatch: | ||
| inputs: | ||
| force_full: | ||
| description: 'Ignore the saved analysis and rebuild it from scratch (full analysis).' | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
|
|
||
| # No workflow-level permissions: each job requests only what it needs (least | ||
| # privilege), so the default token starts with none. | ||
| permissions: {} | ||
|
|
||
| # Reviews queue per pull request, syncs per branch. Closing a pull request cancels its review. | ||
| concurrency: | ||
| group: codeboarding-${{ github.event.pull_request.number || github.event.issue.number || github.ref_name }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} | ||
|
|
||
| jobs: | ||
| review: | ||
| 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)) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| permissions: | ||
| contents: read # check out the repo + read the saved analysis (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 | ||
| steps: | ||
| - uses: CodeBoarding/CodeBoarding-action@refactor/review-baseline-pipeline | ||
| with: | ||
| codeboarding_analysis_branch: 'main' | ||
| # 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 | ||
|
|
||
| sync: | ||
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| permissions: | ||
| contents: write # commit the generated analysis to main | ||
| actions: read # continue from an analysis an earlier run published | ||
| id-token: write # identifies this repo to CodeBoarding's hosted tier | ||
| steps: | ||
| - uses: CodeBoarding/CodeBoarding-action@refactor/review-baseline-pipeline | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In the sync job, every push to Useful? React with 👍 / 👎. |
||
| with: | ||
| mode: sync | ||
| force_full: ${{ inputs.force_full || false }} | ||
| codeboarding_analysis_branch: 'main' | ||
| # 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 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a Dependabot PR,
head.repo.full_namestill equals this repository, so this condition starts the job even though GitHub treats Dependabot-triggered workflows like fork workflows and restricts their token to read-only access. The action relies onid-token: writefor hosted authentication andpull-requests: write/issues: writeto publish its result, so these runs cannot complete the configured review flow. Exclude Dependabot here or route it through a separately secured privileged workflow.Useful? React with 👍 / 👎.