create-release-pr: Add create-release-pr reusable workflow#20
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
.github/scripts/update_changelog.sh
Outdated
| fi | ||
|
|
||
| # Verify the version header was actually inserted | ||
| if ! grep --quiet --fixed-strings "## [$version]" CHANGELOG.md.tmp; then |
There was a problem hiding this comment.
It seems like we can use check_contains here
There was a problem hiding this comment.
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
ea56bad to
d852544
Compare
52c69e2 to
0a766db
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 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>
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.
| 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.
| 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"
| bash "${OLDPWD}/update_changelog.sh" | ||
| ) | ||
| } | ||
| expect_failure_output "fails when VERSION env var missing" "VERSION" test_missing_version_env_var |
There was a problem hiding this comment.
Is there a longer string we could match here? I think it would make the intent of this test clearer.
| # 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.
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