Open MarcoIeni opened 3 months ago
This issue is taken by an external contributor 🎉 They will raise PRs or write in GitHub soon.
I am working on a GH workflow file for rapid prototyping of this functionality. Once the Proof-of-concept is working, I will integrate this into Rust.
So far, I managed to:
admin
, and the maintainers, write
.set-version
arguments and passes them to a release-plz set-version
step.release-please
command step.I got stuck with the last part: committing the changes and updating the release PR. I suspect this last part should be performed using the release-plz release-pr
command. Thus, a signed commit is created using the GitHub API and then pushed to the PR, updating the title and description.
Here you can find the POC workflow file (WIP): https://github.com/LNSD/release-plz-fixtures/blob/08ac25c5373708291b2a8519d7de556eab606c26/.github/workflows/release-cmd.yml
I think for the last part (where you got stuck), it's easier to do it in rust because you could reuse parts of the code of release-pr command. 👍
Here's some docs on how to commit and push to the release pr: https://release-plz.ieni.dev/docs/github/output#example-commit-files-to-the-release-pr
For the record. This is a common use case that I am trying to cover with this release PR workflow command:
- I do my normal development in my project and push an internal logic-breaking change.
- The release-plz action kicks in and creates the release PR (using the
release-pr
command). However, as the change is not in the public-facing API, the version gets a minor/patch version bump (e.g.,v0.2.1
instead ofv0.3.0
)- I want to override the PR's version with a major version bump, so I comment with
/release-plz set-version <package>@<new-version>
.- The comment-triggered workflow, first, should bump the package version, the
set-version
subcommand, and update the different project files.- The comment-triggered workflow, next, should commit the changes and force push them to the release PR. NB: The commit should be signed.
- The command-triggered workflow, finally, should update the release PR title and description (e.g., text, links, etc.) accordingly.
Motivations
It would be nice to quickly run
release-plz set-version
without the need togit checkout
the PR locally.Solution
Release-plz checks the PR comments and reacts to comments respecting the regex
release-plz set-version <set-version-args>
. If one comment is detected, it runs it from gh actions.Note:
Additional context