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

allow customizing the branch #16

Closed
adrianjost opened this issue May 9, 2020 · 8 comments
Closed

allow customizing the branch #16

adrianjost opened this issue May 9, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@adrianjost
Copy link
Owner

adrianjost commented May 9, 2020


This issue has been automatically created by todo-actions based on a TODO comment found in src/git.js:50. It will automatically be closed when the TODO comment is removed from the default branch (master).

@adrianjost adrianjost added the enhancement New feature or request label May 21, 2020
@adrianjost
Copy link
Owner Author

Should this be on a per repo basis or only a single option which is active for all TARGET_REPOS and the SRC_REPO?

@alvarosanchez
Copy link

I think the source branch will be master in the majority of the cases, but maybe a SRC_BRANCH param could be added.

Regarding the target branch(es), ideally one could define some regexs in TARGET_BRANCHES:

TARGET_BRANCH: |-
  ^master$
  ^.*x$  # match 1.1.x, 1.2.x, etc

@adrianjost
Copy link
Owner Author

So you would like to see an option to sync files into multiple branches of the same repo?

@alvarosanchez
Copy link

Correct.

Our use case is that we use this action to sync GitHub Actions workflows, to do releases among other things. In our repos, apart from the master branch, we have maintenance releases for older versions like 1.1.x, 1.2.x, etc. We would like the actions to be sync'ed to those branches too.

@adrianjost
Copy link
Owner Author

@alvarosanchez Just as a quick update for you:
I do not have that much spare time at the moment, but this will be the next feature I implement in this project.


If someone would like to contribute with a PR, I think these are the steps that need to be implemented:

  • fetch all branch names of each repo
  • method to switch branches
  • method to filter list of branches by regex
  • update copy loop with an additional loop to switch between all matching branches of each repo.

All contributions are welcome, even if it is just a comment or issue with a small code-snippet :)

@alvarosanchez
Copy link

No worries.

Anyway, we have moved away from this action and implemented our own with bash scripts, since we needed more customizations.

Thanks anyway!

@adrianjost
Copy link
Owner Author

Thanks for letting me know :)

adrianjost added a commit that referenced this issue Feb 7, 2021
@adrianjost
Copy link
Owner Author

It's now implemented in v1.4.1 🎉🥳
https://github.com/adrianjost/files-sync-action/releases/tag/v1.4.1

You can define multiple branches for a repo by simply defining it multiple times with different branch names.

repoSlug:optionalBranchName

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

No branches or pull requests

2 participants