Skip to content

fix(release): run generate_changelog after update_major_tag - #515

Merged
bedatty merged 3 commits into
developfrom
fix/release-changelog-after-major-tag-update
Jun 25, 2026
Merged

fix(release): run generate_changelog after update_major_tag#515
bedatty merged 3 commits into
developfrom
fix/release-changelog-after-major-tag-update

Conversation

@bedatty

@bedatty bedatty commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
Lerian

GitHub Actions Shared Workflows


Description

generate_changelog and update_major_tag both depended only on [publish_release, publish_release_status], so they ran in parallel. This caused a race condition:

  1. generate_changelog starts and resolves gptchangelog@v1 → fetches the composite code at the current v1 tag (pointing to the previous release)
  2. update_major_tag runs concurrently and moves v1 to the new release commit
  3. The changelog runs with stale code from the previous release — including any bugs that were fixed in the current release

This explains why the jq: error: Could not open file /tmp/api_response.json kept appearing even after the fix was merged: gptchangelog@v1 was resolved before update_major_tag had a chance to update the tag.

Fix: add update_major_tag to generate_changelog's needs to enforce sequencing. The changelog now always runs with the latest v1 code.

Evidence: https://github.com/LerianStudio/github-actions-shared-workflows/actions/runs/28143374372/job/83345332942

Type of Change

  • feat: New workflow or new input/output/step in an existing workflow
  • fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)
  • perf: Performance improvement (e.g. caching, parallelism, reduced steps)
  • refactor: Internal restructuring with no behavior change
  • docs: Documentation only (README, docs/, inline comments)
  • ci: Changes to self-CI (workflows under .github/workflows/ that run on this repo)
  • chore: Dependency bumps, config updates, maintenance
  • test: Adding or updating tests
  • BREAKING CHANGE: Callers must update their configuration after this PR

Breaking Changes

None. generate_changelog still runs under the same conditions — it just waits for update_major_tag to complete first. Total wall-clock time increases by at most the duration of update_major_tag (~30 s).

Testing

  • YAML syntax validated locally
  • Confirmed update_major_tag result is accessible in the generate_changelog if: context (it references publish_release_status.outputs.release_published, not update_major_tag outputs)
  • Checked that unrelated workflows are not affected

Summary by CodeRabbit

  • Chores
    • Improved release workflow sequencing so changelog generation waits for the major tag update step to complete (in addition to existing gating for published releases and changelog being enabled).
  • Improvements
    • Refined AI-generated changelog formatting: uses explicit section headers, cleaner bullet text without repeated commit-type prefixes, enforces a maximum of 5 total bullets across sections, and standardizes how author handles are appended to each bullet.

@bedatty
bedatty requested a review from a team as a code owner June 25, 2026 02:53
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: af7d0dd2-0425-421c-9792-00ce3edb5681

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7958a and b88473f.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Walkthrough

The release workflow now requires generate_changelog to wait for update_major_tag, and the GPT changelog prompt rules were tightened for sectioned bullet output and author formatting.

Changes

Release and changelog updates

Layer / File(s) Summary
Release job ordering
.github/workflows/release.yml
generate_changelog now depends on update_major_tag and only runs after that job succeeds or is skipped, alongside the existing release gates.
GPT prompt rules
src/changelog/gptchangelog/action.yml
The STRICT RULES text now requires explicit Features:, Fixes:, and Improvements: sections, limits total bullets to 5, avoids repeating commit-type prefixes, and refines author handle formatting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main workflow change.
Description check ✅ Passed The description covers the workflow fix, impact, change type, breaking changes, and testing, with only minor template fields omitted.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-changelog-after-major-tag-update

Comment @coderabbitai help to get the list of available commands.

@lerian-studio lerian-studio added size/XS PR changes < 50 lines workflow Changes to one or more reusable workflow files labels Jun 25, 2026
@lerian-studio

lerian-studio commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Validation Summary

✅ PR Mergeable — no blocking failures

Check Status Blocking
Source Branch ✅ success yes
PR Title ✅ success yes
PR Description ✅ success yes
PR Size ✅ success no
Auto Labels ✅ success no
PR Metadata ✅ success no

🔍 View workflow run

@lerian-studio

lerian-studio commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🔍 Lint Analysis

Check Files Scanned Status
YAML Lint 2 file(s) ✅ success
Action Lint 1 file(s) ✅ success
Pinned Actions 2 file(s) ✅ success
Markdown Link Check no changes ⏭️ skipped
Spelling Check 2 file(s) ✅ success
Shell Check 2 file(s) ✅ success
README Check 2 file(s) ✅ success
Composite Schema 1 file(s) ✅ success
Deployment Matrix no changes ⏭️ skipped

🔍 View full scan logs

@lerian-studio

lerian-studio commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis Results

Languages analyzed: actions

✅ No security issues found.


🔍 View full scan logs | 🛡️ Security tab

@bedatty
bedatty force-pushed the fix/release-changelog-after-major-tag-update branch from 1cf283b to 5b7958a Compare June 25, 2026 02:59
@lerian-studio lerian-studio added changelog Changes to changelog generation composite actions (src/changelog/) composite Changes to any composite action manifest (src/**/*.yml) labels Jun 25, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 327-328: The generate_changelog job is being unintentionally gated
by update_major_tag through its needs list, which can skip changelog generation
when enable_major_tag is false. Update generate_changelog in release.yml so it
only depends on the release publishing/status jobs required for changelog
creation, and remove the implicit dependency on update_major_tag while keeping
the existing enable_changelog and release_published condition.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ffd27879-06b0-4e94-b185-1c09416bddbf

📥 Commits

Reviewing files that changed from the base of the PR and between 1cf283b and 5b7958a.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • src/changelog/gptchangelog/action.yml

Comment thread .github/workflows/release.yml Outdated
@bedatty
bedatty merged commit 05f4dd3 into develop Jun 25, 2026
2 checks passed
@github-actions
github-actions Bot deleted the fix/release-changelog-after-major-tag-update branch June 25, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog Changes to changelog generation composite actions (src/changelog/) composite Changes to any composite action manifest (src/**/*.yml) size/XS PR changes < 50 lines workflow Changes to one or more reusable workflow files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants