Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: Ability to sync towards most recent semver release #547

Open
1 task
JakobHavtorn opened this issue Jul 15, 2024 · 4 comments
Open
1 task

[Feat]: Ability to sync towards most recent semver release #547

JakobHavtorn opened this issue Jul 15, 2024 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JakobHavtorn
Copy link

JakobHavtorn commented Jul 15, 2024

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:

  1. Check if this "release-based" sync is enabled.
  2. If not, do as before. If it is, proceed to 3.
  3. Retrieve all tags.
  4. Keep only tags that are semantic versions (e.g. *.*.*).
  5. Sort semvers alphanumerically in descending order.
  6. Select the first entry (most recent release).
  7. Run upstream merge towards this tag instead of main, as before.

Acknowledgements

  • I may be able to implement this feature request
@AndreasAugustin
Copy link
Owner

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? :)

@AndreasAugustin AndreasAugustin added enhancement New feature or request help wanted Extra attention is needed labels Jul 18, 2024
@AndreasAugustin
Copy link
Owner

@all-contributors please add @JakobHavtorn for idea

Copy link
Contributor

@AndreasAugustin

I've put up a pull request to add @JakobHavtorn! 🎉

@AndreasAugustin
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Development

No branches or pull requests

2 participants