Skip to content

Commit 4374cab

Browse files
committed
feat(context-ledger): improve README with simple setup first and add API key validation
- Add simple single-project setup before monorepo setup - Add helpful API key missing comment when ANTHROPIC_API_KEY not found - Clarify that no installation required - just reference action - Better organization for new users vs advanced users
1 parent dd53220 commit 4374cab

File tree

2 files changed

+58
-4
lines changed

2 files changed

+58
-4
lines changed

README.md

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,47 @@ A GitHub Action that maintains a source of truth for LLM context across your cod
2929

3030
## 🚀 Quick Start
3131

32-
### Complete Setup Guide
32+
### Simple Setup (single project)
3333

34-
Follow these steps to set up Context Ledger in your repository:
34+
Add this workflow to `.github/workflows/changelog.yml`:
35+
36+
```yaml
37+
name: Update Changelog
38+
39+
on:
40+
pull_request:
41+
branches: [main]
42+
types: [opened, synchronize, reopened, ready_for_review]
43+
paths-ignore:
44+
- "**/CHANGELOG.md"
45+
- "CHANGELOG.md"
46+
47+
jobs:
48+
update-changelog:
49+
runs-on: ubuntu-latest
50+
permissions:
51+
contents: write
52+
pull-requests: write
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
with:
58+
fetch-depth: 0
59+
60+
- name: Generate Changelog
61+
uses: lukemun/context-ledger@v1
62+
with:
63+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
64+
changelog_path: "CHANGELOG.md"
65+
target_name: "project"
66+
```
67+
68+
This is all most repos need. No installation required — the workflow simply references `lukemun/context-ledger@v1`.
69+
70+
### Monorepo Setup (advanced)
71+
72+
Follow these steps to set up Context Ledger for multi-project repositories:
3573

3674
#### Step 1: Create the Workflow File
3775

@@ -54,6 +92,18 @@ on:
5492
5593
workflow_dispatch:
5694
inputs:
95+
target_changelog:
96+
description: "Target changelog to update"
97+
required: false
98+
default: "project-wide"
99+
type: choice
100+
options:
101+
- "project-wide"
102+
- "your-service-name" # Add your service names here
103+
commit_range:
104+
description: "Number of recent commits to analyze (default: 10)"
105+
required: false
106+
default: "10"
57107
version_increment:
58108
description: "Version increment type"
59109
required: false
@@ -86,7 +136,8 @@ jobs:
86136
with:
87137
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
88138
changelog_path: "CHANGELOG.md"
89-
target_name: "your-project-name"
139+
target_name: ${{ inputs.target_changelog || 'project-wide' }}
140+
commit_range: ${{ inputs.commit_range || '10' }}
90141
version_increment: ${{ inputs.version_increment || 'auto' }}
91142
auto_commit: ${{ github.event_name != 'pull_request' }}
92143
create_pr_suggestions: ${{ github.event_name == 'pull_request' }}
@@ -104,6 +155,8 @@ All notable changes to this project will be documented in this file.
104155
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
105156
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
106157
158+
## [Unreleased]
159+
107160
<!-- Context Ledger will add new entries below this line -->
108161
<!-- AI_APPEND_HERE -->
109162
```
@@ -141,6 +194,7 @@ Create a new pull request and watch Context Ledger analyze your changes and sugg
141194
- **API key required**: Without `ANTHROPIC_API_KEY`, Context Ledger will post a helpful comment with setup instructions
142195
- **First run**: The action will run starting with your first PR after adding the workflow to main
143196
- **Permissions**: Make sure your repository allows Actions to write to PRs (enabled by default)
197+
- **Customize target options**: Update the `target_changelog` options in `workflow_dispatch` to match your project structure (e.g., service names in a monorepo)
144198

145199
### Basic Usage (Alternative)
146200

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ runs:
637637
# Set outputs based on what happened
638638
SHOULD_SKIP="${{ steps.check-suggestions.outputs.should_skip }}"
639639
API_KEY_MISSING="${{ steps.check-api-key.outputs.api_key_missing }}"
640-
640+
641641
if [ "$SHOULD_SKIP" == "true" ]; then
642642
echo "status=SKIPPED" >> $GITHUB_OUTPUT
643643
echo "changelog_updated=false" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)