create-release-pr: Add create-release-pr reusable workflow#20
Conversation
60d920f to
a74cd2c
Compare
d46ea87 to
4744110
Compare
There was a problem hiding this comment.
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.ymlreusable workflow to generate a version bump branch/commit and open a PR from a fork. - Extend
release-version-extractto outputunreleased_changesand document the new output inREADME.md. - Update docs/changelog and bump the
actions/checkoutversion 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.
40eab2b to
eb76833
Compare
18a7fdc to
cdfb6a1
Compare
fantapop
left a comment
There was a problem hiding this comment.
I didn't quite finish but left some feedback
ea56bad to
d852544
Compare
1fa2373 to
79f2591
Compare
fantapop
left a comment
There was a problem hiding this comment.
This is looking really close. I left some nits and one regarding expect_diff.
actions_helpers_test.sh
Outdated
| 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 |
There was a problem hiding this comment.
Is this the the desired behavior? It seems like we might actually just want to fail out.
There was a problem hiding this comment.
Updated this to fail, good catch
| echo "$output" | check_contains "File not found" | ||
| echo "$output" | check_contains "missing_file.txt" |
There was a problem hiding this comment.
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"
test_helpers.sh
Outdated
| # Check if diff contains the expected string (exact match, not regex) | ||
| if echo "$actual_diff" | check_contains "$expected_diff"; then |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I updated the test helper to accept the full expected diff and updated the function to check for exact match
79f2591 to
c894223
Compare
| } | ||
|
|
||
| # Assert that input contains a given substring. | ||
| # Usage: check_contains "expected" "$file" (reads file) |
There was a problem hiding this comment.
Side note, the file reading part of this function seems odd. I went and looked at existing usages of it and it seems like it's for checking that the GITHUB_OUTPUT has the string in it. Almost all of our usages if check_contains are checking to see if a string has another string. I don't think we should change it for this PR but maybe something to consider for a future change.
c894223 to
23c6384
Compare
|
@fantapop Updated the test helper to fail if the diff contains two hunks since in our current use cases, we are only expecting one |
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>
23c6384 to
fe1dd13
Compare
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