Skip to content

Commit d8207a4

Browse files
committed
feat: Added manual manual changelog generation capability in CI pipeline. Added flexibility in content scoping for the changelog
1 parent 73d8ef1 commit d8207a4

3 files changed

Lines changed: 33 additions & 7 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
812

913
jobs:
1014
test:
@@ -71,17 +75,21 @@ jobs:
7175
changelog:
7276
name: Generate Changelog
7377
runs-on: ubuntu-latest
74-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Only runs on push to main
78+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
7579
steps:
7680
- name: Checkout code
7781
uses: actions/checkout@v4
7882
with:
79-
fetch-depth: 100 # Fetch enough history for the log
83+
fetch-depth: 0 # Fetch all history for the log
84+
85+
- name: Set up Python
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: "3.10"
8089

8190
- name: Generate Changelog Entry
82-
# We run the script directly. In a real scenario, this step might modify the file
83-
# and create a PR, or just upload the artifact.
84-
# For now, it appends to CHANGELOG.md in the runner.
91+
# We run the script directly.
92+
# It appends to CHANGELOG.md in the runner.
8593
run: python3 scripts/generate_changelog.py
8694

8795
- name: Upload Changelog Artifact

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## [Unreleased] - 2025-12-17
2+
3+
**Focus:** Feature Development
4+
5+
### 🧠 Temporal Context & Intent
6+
> *Auto-generated: Add context about why these changes were made.*
7+
8+
### 🏗️ Architectural Impact
9+
> *Auto-generated: Describe high-level architectural shifts.*
10+
11+
### 📝 Delta Changes
12+
13+
#### 🚀 Features
14+
* Add Runtime Signals to the knowledge graph: Cobertura test coverage report processing, associated new entity and relationship types, and integrate into graph building. (`73d8ef1`)

scripts/generate_changelog.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,13 @@ def generate_entry(commits):
133133
def main():
134134
changelog_path = Path("CHANGELOG.md")
135135

136+
# Allow range to be passed as argument
137+
range_str = "HEAD~5..HEAD"
138+
if len(sys.argv) > 1:
139+
range_str = sys.argv[1]
140+
136141
# In a real CI, we might compare against the last tag.
137-
# For now, we'll just grab the inputs or default to last 10 commits for demo.
138-
commits_raw = get_git_log("HEAD~5..HEAD")
142+
commits_raw = get_git_log(range_str)
139143
parsed_commits = [parse_commit(c) for c in commits_raw if c]
140144
parsed_commits = [c for c in parsed_commits if c] # filter Nones
141145

0 commit comments

Comments
 (0)