Skip to content

Commit a7cdd3b

Browse files
committed
Release patches
1 parent 47c2928 commit a7cdd3b

File tree

3 files changed

+45
-278
lines changed

3 files changed

+45
-278
lines changed

LICENSE

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
PROPRIETARY SOFTWARE LICENSE
1+
MIT License
22

3-
Copyright (c) 2024 CodeBoarding. All rights reserved.
3+
Copyright (c) 2024 CodeBoarding
44

5-
RESTRICTIONS:
6-
This software and associated documentation files (the "Software") are proprietary
7-
and confidential. No rights are granted to any person or entity to use, copy,
8-
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
911

10-
PROHIBITED ACTIVITIES:
11-
- Use of this Software without explicit written permission
12-
- Copying, modifying, or distributing the Software
13-
- Creating derivative works based on the Software
14-
- Reverse engineering, decompiling, or disassembling the Software
15-
- Using the Software for commercial or non-commercial purposes
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1614

17-
ENFORCEMENT:
18-
Any unauthorized use of this Software is strictly prohibited and may result in
19-
severe civil and criminal penalties. Violators will be prosecuted to the
20-
maximum extent possible under law.
21-
22-
NO WARRANTY:
23-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26-
27-
For licensing inquiries, contact: [[email protected]]
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 27 additions & 254 deletions
Original file line numberDiff line numberDiff line change
@@ -1,281 +1,54 @@
1-
# CodeBoarding GitHub Action
1+
# CodeBoarding [Diagram-First Documentation]
22

3-
A composite GitHub Action that fetches documentation files from a CodeBoarding service and saves them as markdown files in your repository.
3+
[![GitHub Action](https://img.shields.io/badge/GitHub-Action-blue?logo=github-actions)](https://github.com/marketplace/actions/codeboarding-diagram-first-documentation)
44

5-
## Features
6-
7-
- 🚀 **Simple Integration**: Easy to use composite action
8-
- 📁 **Flexible Output**: Configurable output directory (default: `.codeboarding`)
9-
- 🔄 **Smart Processing**: Automatically adds `.md` extension if needed
10-
- 📊 **Detailed Outputs**: Provides information about created files and changes
11-
- 🛡️ **Error Handling**: Robust error handling for API calls and JSON parsing
12-
13-
## How it works
14-
15-
1. The action determines the repository URL (current repo or provided)
16-
2. Calls your CodeBoarding endpoint with the repository URL as a query parameter
17-
3. Receives a JSON response with files and their content
18-
4. Creates/updates files in the specified output directory with `.md` extension
19-
5. Provides outputs that can be used by subsequent workflow steps
5+
Generates diagram-first visualizations of your codebase using static analysis and large language models.
206

217
## Usage
228

23-
### Basic Usage
24-
25-
```yaml
26-
- name: Fetch CodeBoarding Documentation
27-
uses: your-username/codeboarding-action@v1
28-
with:
29-
endpoint_url: 'https://your-api-endpoint.com/generate_docs'
30-
```
31-
32-
### Advanced Usage
33-
34-
```yaml
35-
- name: Fetch CodeBoarding Documentation
36-
id: codeboarding
37-
uses: your-username/codeboarding-action@v1
38-
with:
39-
endpoint_url: ${{ vars.CODEBOARDING_ENDPOINT }}
40-
repository_url: 'https://github.com/owner/repo' # Optional: defaults to current repo
41-
output_directory: 'docs/generated' # Optional: defaults to .codeboarding
42-
43-
- name: Check results
44-
run: |
45-
echo "Files created: ${{ steps.codeboarding.outputs.files_created }}"
46-
echo "Has changes: ${{ steps.codeboarding.outputs.has_changes }}"
47-
```
48-
49-
### Complete Workflow with PR Creation
50-
519
```yaml
52-
name: Update Documentation
53-
10+
name: Generate Documentation
5411
on:
55-
schedule:
56-
- cron: '0 2 * * *' # Daily at 2 AM
57-
workflow_dispatch:
12+
push:
13+
branches: [ main ]
14+
pull_request:
15+
branches: [ main ]
5816

5917
jobs:
60-
update-docs:
18+
documentation:
6119
runs-on: ubuntu-latest
62-
permissions:
63-
contents: write
64-
pull-requests: write
65-
6620
steps:
67-
- uses: actions/checkout@v4
68-
69-
- name: Fetch Documentation
70-
id: docs
71-
uses: your-username/codeboarding-action@v1
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Generate Documentation
25+
uses: your-username/CodeBoarding-GHAction@v1
7226
with:
73-
endpoint_url: ${{ vars.CODEBOARDING_ENDPOINT }}
74-
75-
- name: Create Pull Request
76-
if: steps.docs.outputs.has_changes == 'true'
77-
uses: peter-evans/create-pull-request@v5
27+
repository_url: ${{ github.server_url }}/${{ github.repository }}
28+
output_directory: '.codeboarding'
29+
30+
- name: Upload Documentation
31+
uses: actions/upload-artifact@v4
7832
with:
79-
token: ${{ secrets.GITHUB_TOKEN }}
80-
commit-message: "docs: update codeboarding documentation"
81-
title: "📚 Documentation Update"
82-
body: |
83-
Updated ${{ steps.docs.outputs.files_created }} documentation files.
84-
branch: docs/update
33+
name: documentation
34+
path: .codeboarding/
8535
```
8636
8737
## Inputs
8838
8939
| Input | Description | Required | Default |
9040
|-------|-------------|----------|---------|
91-
| `endpoint_url` | URL of the CodeBoarding service endpoint | Yes | - |
92-
| `repository_url` | Repository URL to analyze (defaults to current repo) | No | Current repository |
93-
| `output_directory` | Directory where files will be saved | No | `.codeboarding` |
41+
| `repository_url` | Repository URL to fetch documentation for | Yes | - |
42+
| `output_directory` | Directory where documentation files will be saved | No | `.codeboarding` |
9443

9544
## Outputs
9645

9746
| Output | Description |
9847
|--------|-------------|
99-
| `files_created` | Number of files created/updated |
48+
| `files_created` | Number of files created |
10049
| `output_directory` | Directory where files were saved |
101-
| `has_changes` | Whether any files were created or changed (`true`/`false`) |
102-
103-
## Setup
104-
105-
### 1. Configure the endpoint URL
106-
107-
You have several options to configure the endpoint URL:
108-
109-
**Option A: Using repository variables (recommended)**
110-
1. Go to your repository Settings > Secrets and variables > Actions
111-
2. In the "Variables" tab, create a new variable:
112-
- Name: `CODEBOARDING_ENDPOINT`
113-
- Value: `https://your-api-endpoint.com/generate_docs` (replace with your actual endpoint)
114-
115-
**Option B: Pass directly in workflow**
116-
```yaml
117-
- uses: your-username/codeboarding-action@v1
118-
with:
119-
endpoint_url: 'https://your-api-endpoint.com/generate_docs'
120-
```
121-
122-
### 2. Expected API Response Format
123-
124-
Your endpoint should return a JSON response in this format:
125-
126-
```json
127-
{
128-
"repository": "owner/repo-name",
129-
"files": {
130-
"getting-started": "# Getting Started\n\nThis is the content...",
131-
"api-reference": "# API Reference\n\nAPI documentation...",
132-
"troubleshooting": "# Troubleshooting\n\nCommon issues..."
133-
}
134-
}
135-
```
136-
137-
- `repository`: The repository name (informational)
138-
- `files`: A dictionary where keys are filenames and values are the markdown content
139-
140-
### 2. Expected API Response Format
141-
142-
Your endpoint should return a JSON response in this format:
143-
144-
```json
145-
{
146-
"repository": "owner/repo-name",
147-
"files": {
148-
"getting-started": "# Getting Started\n\nThis is the content...",
149-
"api-reference": "# API Reference\n\nAPI documentation...",
150-
"troubleshooting": "# Troubleshooting\n\nCommon issues..."
151-
}
152-
}
153-
```
154-
155-
- `repository`: The repository name (informational, optional)
156-
- `files`: A dictionary where keys are filenames and values are the markdown content
157-
158-
### 3. Permissions
159-
160-
When using this action in workflows that create PRs or commits, ensure your workflow has the necessary permissions:
161-
162-
```yaml
163-
jobs:
164-
your-job:
165-
permissions:
166-
contents: write # For committing files
167-
pull-requests: write # For creating PRs
168-
```
169-
170-
## Design Philosophy
171-
172-
This composite action follows the **single responsibility principle**:
173-
174-
- ✅ **Does one thing well**: Fetches and saves documentation files
175-
- ✅ **Flexible output**: You decide what to do with the files (commit, PR, etc.)
176-
- ✅ **Composable**: Can be combined with other actions easily
177-
- ✅ **Testable**: Clear inputs and outputs make testing straightforward
178-
179-
## Examples
180-
181-
### Example 1: Save to Custom Directory
182-
183-
```yaml
184-
- uses: your-username/codeboarding-action@v1
185-
with:
186-
endpoint_url: ${{ vars.CODEBOARDING_ENDPOINT }}
187-
output_directory: 'documentation/auto-generated'
188-
```
189-
190-
### Example 2: Analyze Different Repository
191-
192-
```yaml
193-
- uses: your-username/codeboarding-action@v1
194-
with:
195-
endpoint_url: ${{ vars.CODEBOARDING_ENDPOINT }}
196-
repository_url: 'https://github.com/other-org/other-repo'
197-
```
198-
199-
### Example 3: Conditional Processing
200-
201-
```yaml
202-
- name: Generate docs
203-
id: docs
204-
uses: your-username/codeboarding-action@v1
205-
with:
206-
endpoint_url: ${{ vars.CODEBOARDING_ENDPOINT }}
207-
208-
- name: Only proceed if files were created
209-
if: steps.docs.outputs.has_changes == 'true'
210-
run: |
211-
echo "Processing ${{ steps.docs.outputs.files_created }} new files..."
212-
# Your custom logic here
213-
```
214-
215-
## Troubleshooting
216-
217-
### Common Issues
218-
219-
1. **API endpoint returns non-200 status**
220-
- Check that your endpoint URL is correct
221-
- Verify the endpoint is accessible from GitHub Actions runners
222-
- Check endpoint logs for errors
223-
224-
2. **Invalid JSON response**
225-
- Ensure your endpoint returns valid JSON
226-
- Check that the response includes the expected `files` key
227-
228-
3. **No files created**
229-
- Verify the API response contains a `files` object with content
230-
- Check the action logs for debugging information
231-
232-
### Debug Mode
233-
234-
The action includes extensive logging. Check the action logs in your workflow runs for detailed information about:
235-
- API request and response
236-
- JSON parsing results
237-
- File creation process
238-
- `contents: write` - to create commits
239-
- `pull-requests: write` - to create pull requests
240-
241-
## Usage
242-
243-
### Automatic execution
244-
- The action runs daily at 2 AM UTC
245-
- Scheduled runs can be configured by modifying the cron expression in the workflow
246-
247-
### Manual execution
248-
1. Go to Actions tab in your repository
249-
2. Select "Documentation Update" workflow
250-
3. Click "Run workflow"
251-
252-
## File handling
253-
254-
- Files are created in the `.codeboarding` directory
255-
- All files automatically get `.md` extension if not already present
256-
- Existing files are overwritten with new content
257-
- Only creates a PR if there are actual changes
258-
259-
## Pull Request behavior
260-
261-
- PR title: "doc update"
262-
- Branch name: `docs/codeboarding-update`
263-
- Automatically deletes the branch after PR is merged/closed
264-
- Only creates PR if there are changes to commit
265-
266-
## Troubleshooting
267-
268-
### API call fails
269-
- Check that your endpoint URL is correct
270-
- Verify the endpoint is accessible from GitHub Actions runners
271-
- Check the Actions logs for the exact error message
50+
| `has_changes` | Whether any files were created or changed |
27251

273-
### No PR created
274-
- This means no changes were detected
275-
- The API response might be identical to existing files
276-
- Check the "Check for changes" step in the workflow logs
52+
## License
27753

278-
### Invalid JSON response
279-
- Verify your endpoint returns valid JSON
280-
- Check the response format matches the expected structure
281-
- Review the API response in the workflow logs
54+
MIT License - see [LICENSE](LICENSE) file for details.

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'CodeBoarding [Diagram-First Documentation]
1+
name: 'CodeBoarding [Diagram-First Documentation]'
22
description: 'Generates diagram-first visualizations of your codebase using static analysis and large language models.'
33
author: 'CodeBoarding'
44

0 commit comments

Comments
 (0)