Skip to content

Commit 5f300bd

Browse files
committed
feat(context-ledger): add self-hosted changelog workflow
- Context Ledger now uses itself to maintain its own changelog - Added changelog.yml workflow that runs on PRs and releases - Demonstrates the action's capabilities on its own repository
1 parent 42d45e1 commit 5f300bd

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/changelog.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Update Changelog
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
paths-ignore:
8+
- "docs/**"
9+
- "**/CHANGELOG.md"
10+
- "CHANGELOG.md"
11+
12+
release:
13+
types: [published]
14+
15+
workflow_dispatch:
16+
inputs:
17+
version_increment:
18+
description: "Version increment type"
19+
required: false
20+
default: "auto"
21+
type: choice
22+
options:
23+
- "auto"
24+
- "patch"
25+
- "minor"
26+
- "major"
27+
28+
permissions:
29+
contents: write
30+
pull-requests: write
31+
issues: write
32+
33+
jobs:
34+
update-changelog:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
with:
40+
ref: ${{ github.event.pull_request.head.ref }}
41+
fetch-depth: 0
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Update Changelog with Context Ledger
45+
uses: lukemun/context-ledger@v1
46+
with:
47+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
48+
changelog_path: 'CHANGELOG.md'
49+
target_name: 'context-ledger'
50+
version_increment: ${{ inputs.version_increment || 'auto' }}
51+
auto_commit: ${{ github.event_name != 'pull_request' }}
52+
create_pr_suggestions: ${{ github.event_name == 'pull_request' }}

0 commit comments

Comments
 (0)