Skip to content

create-release-pr: Add create-release-pr reusable workflow#20

Open
linhcrl wants to merge 1 commit intomainfrom
version-bump-workflow
Open

create-release-pr: Add create-release-pr reusable workflow#20
linhcrl wants to merge 1 commit intomainfrom
version-bump-workflow

Conversation

@linhcrl
Copy link
Copy Markdown
Contributor

@linhcrl linhcrl commented Mar 30, 2026

Automates creation of release pull requests by detecting unreleased changes in CHANGELOG.md, determining the next semantic version, updating the changelog with the release date, and creating a PR from a fork to the upstream repository.

Supports configurable release dates, custom git identity, and optional update scripts for projects that maintain version numbers in multiple files.

Updates release-version-extract action to expose unreleased_changes output, making changelog entries available for use in commit messages and PR bodies.

Co-Authored-By: roachdev-claude roachdev-claude-bot@cockroachlabs.com

@linhcrl linhcrl force-pushed the version-bump-workflow branch 3 times, most recently from 60d920f to a74cd2c Compare March 31, 2026 07:31
@linhcrl linhcrl changed the title Add version-bump reusable workflow version-bump: Add version-bump reusable workflow Mar 31, 2026
@linhcrl linhcrl requested a review from fantapop March 31, 2026 07:47
@fantapop fantapop requested a review from Copilot March 31, 2026 20:17
@linhcrl linhcrl force-pushed the version-bump-workflow branch 2 times, most recently from d46ea87 to 4744110 Compare March 31, 2026 20:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new reusable GitHub workflow to automate version bump PR creation, and extends the existing release-version-extract action to expose unreleased changelog text for use in commit messages and PR bodies.

Changes:

  • Add .github/workflows/version-bump.yml reusable workflow to generate a version bump branch/commit and open a PR from a fork.
  • Extend release-version-extract to output unreleased_changes and document the new output in README.md.
  • Update docs/changelog and bump the actions/checkout version used in the repo test workflow.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
release-version-extract/action.yml Exposes unreleased_changes output from the changelog reader step.
README.md Documents unreleased_changes, adds docs for get-workflow-ref, and documents the new version-bump workflow.
CHANGELOG.md Notes the addition of the new version-bump reusable workflow.
.github/workflows/version-bump.yml New reusable workflow implementing the version bump PR automation.
.github/workflows/test.yml Updates the checkout action version used in CI.
Comments suppressed due to low confidence (2)

.github/workflows/version-bump.yml:221

  • The PR body is built with a double-quoted Bash string that directly interpolates steps.extract-version.outputs.unreleased_changes. Changelog content containing quotes/newlines/$()/backticks can break the assignment or trigger shell expansion. Prefer constructing the body using a quoted heredoc (no interpolation) and/or pass the changelog content through an env var to avoid evaluation.
    CHANGELOG.md:23
  • This changelog entry refers to “CHANGELOG” (no extension) while the rest of the repo/docs consistently use CHANGELOG.md. Consider standardizing the filename here to avoid confusion.
### Changed

- `autotag-from-changelog` action: now automatically creates and updates major
  version tags (e.g., `v1`) when pushing semver tags (e.g., `v1.2.3`), allowing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@linhcrl linhcrl force-pushed the version-bump-workflow branch 3 times, most recently from 40eab2b to eb76833 Compare March 31, 2026 20:52
@linhcrl linhcrl changed the title version-bump: Add version-bump reusable workflow create-release-pr: Add create-release-pr reusable workflow Mar 31, 2026
@linhcrl linhcrl force-pushed the version-bump-workflow branch 5 times, most recently from 18a7fdc to cdfb6a1 Compare April 3, 2026 21:48
@linhcrl linhcrl requested a review from fantapop April 3, 2026 21:50
Copy link
Copy Markdown
Contributor

@fantapop fantapop left a comment

Choose a reason for hiding this comment

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

I didn't quite finish but left some feedback

fi

# Verify the version header was actually inserted
if ! grep --quiet --fixed-strings "## [$version]" CHANGELOG.md.tmp; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems like we can use check_contains here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. I ended up having to move check_contains to the actions_helpers.sh file in order to enable this though. Initially it was in test_helpers.sh. I also moved check_contains_pattern for parity

@linhcrl linhcrl force-pushed the version-bump-workflow branch 7 times, most recently from ea56bad to d852544 Compare April 5, 2026 06:07
@linhcrl linhcrl force-pushed the version-bump-workflow branch 2 times, most recently from 52c69e2 to 0a766db Compare April 5, 2026 06:25
Automates creation of release pull requests by detecting unreleased
changes in CHANGELOG.md, determining the next semantic version, updating
the changelog with the release date, and creating a PR from a fork to
the upstream repository.

Supports optional build scripts for projects that maintain version
numbers in multiple files.

Updates release-version-extract action to expose unreleased_changes
output, making changelog entries available for use in commit messages
and PR bodies.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@linhcrl linhcrl force-pushed the version-bump-workflow branch from 1fa2373 to 79f2591 Compare April 5, 2026 06:41
Copy link
Copy Markdown
Contributor

@fantapop fantapop left a comment

Choose a reason for hiding this comment

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

This is looking really close. I left some nits and one regarding expect_diff.

Comment on lines +151 to +160
test_get_base_branch_gh_failure() {
# Test in a directory that's not a git repo - gh should fail
(
cd "$TMPDIR_TEST"
local result
result=$(get_base_branch "" "owner/repo" 2>&1)
echo "$result" | check_contains "main"
)
}
expect_success "get_base_branch: falls back to main when gh fails" test_get_base_branch_gh_failure
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this the the desired behavior? It seems like we might actually just want to fail out.

Comment on lines +155 to +156
echo "$output" | check_contains "File not found"
echo "$output" | check_contains "missing_file.txt"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there more we can match on here to make it clear it's a warning ? i.e. check_contains_pattern "Warning.*missing_file.txt"

bash "${OLDPWD}/update_changelog.sh"
)
}
expect_failure_output "fails when VERSION env var missing" "VERSION" test_missing_version_env_var
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a longer string we could match here? I think it would make the intent of this test clearer.

Comment on lines +179 to +180
# Check if diff contains the expected string (exact match, not regex)
if echo "$actual_diff" | check_contains "$expected_diff"; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you not worried this guarantee will be too weak? It means the diff could contain extra unexpected stuff but the test would still pass. If you were worried about the readability of including the additional lines you could dial down the diff context to 1 or even 0 to achieve the same effect but with the added bonus it would fail if there were extra things in the diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants