[Feat]: Ability to sync towards most recent semver release
Describe the feature
Always syncing to the most recent commit to main is useful, but in some release schedules, several PRs might be accumulated in main before a new release is made. Being able to sync towards the most recent release (as measured by semantic versioning) would be a good way to make the synchronisation even more structured. It would also be very useful to have an Action variable that contains the release notes for the release tag we are syncing against, so these notes can be included in the PR description.
Use Case
This would enable
- Creating a sync PR only when the template repository gets a release. This ensures more "well-packaged" sync PRs.
- Referring directly and transparently to which changes are included in an upstream merge via the release notes.
Proposed Solution
I imagine the implementation would consist of steps similar to:
- Check if this "release-based" sync is enabled.
- If not, do as before. If it is, proceed to 3.
- Retrieve all tags.
- Keep only tags that are semantic versions (e.g.
*.*.*). - Sort semvers alphanumerically in descending order.
- Select the first entry (most recent release).
- Run upstream merge towards this tag instead of
main, as before.
Acknowledgements
- [ ] I may be able to implement this feature request
Hi @JakobHavtorn , I understand your idea and the use case. Most likely will help. Maybe as a first step an option to sync the tags makes sense. Currently (due to some time constraints) I cannot give an ETA when I am able to start this feature. Maybe someone is able to jump in? :)
@all-contributors please add @JakobHavtorn for idea
@JakobHavtorn sorry for delay. At least I have a PR available to sync the tags (first step). #561 Actually the code is already there since a while, did not have time yet to test. If you want to check this feature please use smth like
on:
# manual trigger
workflow_dispatch:
jobs:
repo-sync:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: write
pull-requests: write
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v4
- name: actions-template-sync
uses: AndreasAugustin/actions-template-sync@feat/547_tags # reference the branch
with:
source_repo_path: <owner/repo>
upstream_branch: <target_branch> # defaults to main
is_with_tags: true # new property