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]: Add possibity to change the branch of the source repo #621

Open
1 task done
msiebeneicher opened this issue Feb 19, 2025 · 1 comment
Open
1 task done

Comments

@msiebeneicher
Copy link
Contributor

Describe the feature

We would like to change the branch of the source repository to sync from

Use Case

We use a version branch v1 in our source (template) repo to be able to handle breaking changes there. Now we figured out that we can only merge the main source branch in the action.

https://github.com/AndreasAugustin/actions-template-sync/blob/main/src/sync_template.sh#L275

Proposed Solution

We use a dirty workaround and "misuse" the existing git_remote_pull_params parameter : v1 --allow-unrelated-histories --squash --strategy=recursiv e -X theirs

GIT_REMOTE_PULL_PARAMS="${GIT_REMOTE_PULL_PARAMS:---allow-unrelated-histories --squash --strategy=recursive -X theirs}"

Better would be to add a new optional parameter like source_branch (default '') which can be used like eval "git pull ${source_repo} ${source_branch} --tags ${git_remote_pull_params}" || pull_has_issues=true

https://github.com/AndreasAugustin/actions-template-sync/blob/main/src/sync_template.sh#L275

Acknowledgements

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

AndreasAugustin commented Feb 19, 2025

Hi @msiebeneicher and thanks a lot for the suggestion.
Actually the idea behind the git_remote_pull_params are also to include possible branches there.
But ok out of convenience reasons I think it makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants