Repository navigation
Automatically generate change logs on release #18401
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3bd2159
Changelogs for 0.27.0 and 0.28.0-preview0
g-samroberts d52547d
Moves releases to top level sidebar for now.
g-samroberts 31573f3
Update docs/changelogs/latest.md
g-samroberts 62b04b9
Update index.md
g-samroberts 1c226db
Update index.md
g-samroberts f5496db
Update latest.md
g-samroberts 28e403a
Fix formatting.
g-samroberts 12501c3
Initial workflow and skill for changelog
g-samroberts b828186
Update SKILL.md
g-samroberts 4e271a0
Merge branch 'main' into generate-changelog
g-samroberts af47b32
Add blank line at end of release-notes.yml
g-samroberts b4d43a7
Slight modifications based on linter results.
g-samroberts 6c8ab91
Merge branch 'generate-changelog' of https://github.com/google-gemini…
g-samroberts 8fa118f
Fix additional linter errors.
g-samroberts 3e69be2
Add wofklow_dispatch for manual runs.
g-samroberts 9f0a29c
Fixes based on comments.
g-samroberts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| --- | ||
| name: docs-changelog | ||
| description: Provides a step-by-step procedure for generating Gemini CLI changelog files based on github release information. | ||
| --- | ||
|
|
||
| # Procedure: Updating Changelog for New Releases | ||
|
|
||
| The following instructions are run by Gemini CLI when processing new releases. | ||
|
|
||
| ## Objective | ||
|
|
||
| To standardize the process of updating the Gemini CLI changelog files for a new | ||
| release, ensuring accuracy, consistency, and adherence to project style | ||
| guidelines. | ||
|
|
||
| ## Release Types | ||
|
|
||
| This skill covers two types of releases: | ||
|
|
||
| * **Standard Releases:** Regular, versioned releases that are announced to all | ||
| users. These updates modify `docs/changelogs/latest.md` and | ||
| `docs/changelogs/index.md`. | ||
| * **Preview Releases:** Pre-release versions for testing and feedback. These | ||
| updates only modify `docs/changelogs/preview.md`. | ||
|
|
||
| Ignore all other releases, such as nightly releases. | ||
|
|
||
| ### Expected Inputs | ||
|
|
||
| Regardless of the type of release, the following information is expected: | ||
|
|
||
| * **New version number:** The version number for the new release | ||
| (e.g., `v0.27.0`). | ||
| * **Release date:** The date of the new release (e.g., `2026-02-03`). | ||
| * **Raw changelog data:** A list of all pull requests and changes | ||
| included in the release, in the format `description by @author in | ||
| #pr_number`. | ||
| * **Previous version number:** The version number of the last release | ||
| (e.g., `v0.26.0`). | ||
|
|
||
| ## Procedure | ||
|
|
||
| ### Initial Setup | ||
|
|
||
| 1. Identify the files to be modified: | ||
|
|
||
| For standard releases, update `docs/changelogs/latest.md` and | ||
| `docs/changelogs/index.md`. For preview releases, update | ||
| `docs/changelogs/preview.md`. | ||
|
|
||
| 2. Activate the `docs-writer` skill. | ||
|
|
||
| ### Analyze Raw Changelog Data | ||
|
|
||
| 1. Review the complete list of changes. If it is a patch or a bug fix with few | ||
| changes, skip to the "Update `docs/changelogs/latest.md` or | ||
| `docs/changelogs/preview.md`" section. | ||
|
|
||
| 2. Group related changes into high-level categories such as | ||
| important features, "UI/UX Improvements", and "Bug Fixes". Use the existing | ||
| announcements in `docs/changelogs/index.md` as an example. | ||
|
|
||
| ### Create Highlight Summaries | ||
|
|
||
| Create two distinct versions of the release highlights. | ||
|
|
||
| **Important:** Carefully inspect highlights for "experimental" or | ||
| "preview" features before public announcement, and do not include them. | ||
|
|
||
| #### Version 1: Comprehensive Highlights (for `latest.md` or `preview.md`) | ||
|
|
||
| Write a detailed summary for each category focusing on user-facing | ||
| impact. | ||
|
|
||
| #### Version 2: Concise Highlights (for `index.md`) | ||
|
|
||
| Skip this step for preview releases. | ||
|
|
||
| Write concise summaries including the primary PR and author | ||
| (e.g., `([#12345](link) by @author)`). | ||
|
|
||
| ### Update `docs/changelogs/latest.md` or `docs/changelogs/preview.md` | ||
|
|
||
| 1. Read current content and use `write_file` to replace it with the new | ||
| version number, and date. | ||
|
|
||
| If it is a patch or bug fix with few changes, simply add these | ||
| changes to the "What's Changed" list. Otherwise, replace comprehensive | ||
| highlights, and the full "What's Changed" list. | ||
|
|
||
| 2. For each item in the "What's Changed" list, keep usernames in plaintext, and | ||
| add github links for each issue number. Example: | ||
|
|
||
| "- feat: implement /rewind command by @username in | ||
| [#12345](https://github.com/google-gemini/gemini-cli/pull/12345)" | ||
|
|
||
| 3. Skip entries by @gemini-cli-robot. | ||
|
|
||
| 4. Do not add the "New Contributors" section. | ||
|
|
||
| 5. Update the "Full changelog:" link with the previous version and the new | ||
| vesion, unless it is a patch or a bug fix, in which case simply update the | ||
| link's new version and keep the previous version the same. | ||
|
|
||
| 6. Ensure lines are wrapped to 80 characters. | ||
|
|
||
| ### Update `docs/changelogs/index.md` | ||
|
|
||
| Skip this step for patches, bug fixes, or preview releases. | ||
|
|
||
| Insert a new "Announcements" section for the new version directly | ||
| above the previous version's section. Ensure lines are wrapped to | ||
| 80 characters. | ||
|
|
||
| ### Finalize | ||
|
|
||
| Run `npm run format` to ensure consistency. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # This workflow is triggered on every new release. | ||
| # It uses Gemini to generate release notes and creates a PR with the changes. | ||
| name: Generate Release Notes | ||
|
|
||
| on: | ||
| release: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| generate-release-notes: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # The user-level skills need to be available to the workflow | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Get release information | ||
| id: release_info | ||
| run: | | ||
| VERSION="${{ github.event.release.tag_name }}" | ||
| # Get the previous release tag | ||
| PREVIOUS_VERSION=$(gh release list --limit 1 --exclude-drafts --exclude-prereleases --json tagName -q '.[0].tagName' | sed 's/^v//') | ||
|
|
||
| # Sanitize the release body to be passed as a command-line argument | ||
| # This replaces newlines with a special marker to be undone in the prompt | ||
| RAW_CHANGELOG=$(echo "${{ github.event.release.body }}" | tr '\n' '%%NEWLINE%%') | ||
|
|
||
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT | ||
| echo "RAW_CHANGELOG=$RAW_CHANGELOG" >> $GITHUB_OUTPUT | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Generate Changelog with Gemini | ||
| uses: 'google-github-actions/run-gemini-cli@a3bf79042542528e91937b3a3a6fbc4967ee3c31' # ratchet:google-github-actions/run-gemini-cli@v0 | ||
| env: | ||
| VERSION: ${{ steps.release_info.outputs.VERSION }} | ||
| PREVIOUS_VERSION: ${{ steps.release_info.outputs.PREVIOUS_VERSION }} | ||
| RAW_CHANGELOG: ${{ steps.release_info.outputs.RAW_CHANGELOG }} | ||
| with: | ||
| gemini_api_key: ${{ secrets.GEMINI_API_KEY }} | ||
| prompt: | | ||
| Activate the 'docs-changelog' skill. | ||
|
|
||
| **Release Information:** | ||
| - New Version: $VERSION | ||
| - Previous Version: $PREVIOUS_VERSION | ||
| - Release Date: $(date +%Y-%m-%d) | ||
|
g-samroberts marked this conversation as resolved.
Outdated
|
||
| - Raw Changelog Data (newlines replaced with '%%NEWLINE%%'): $RAW_CHANGELOG | ||
|
|
||
| Execute the release notes generation process using the information provided. | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| commit-message: "docs(changelog): update for ${{ steps.release_info.outputs.VERSION }}" | ||
| title: "Changelog for ${{ steps.release_info.outputs.VERSION }}" | ||
| body: | | ||
| This PR contains the auto-generated changelog for the ${{ steps.release_info.outputs.VERSION }} release. | ||
|
|
||
| Please review and merge. | ||
| branch: "changelog-${{ steps.release_info.outputs.VERSION }}" | ||
| delete-branch: true | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.