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

Feature Proposal: Submodules on the same branch #401

Open
jberaud opened this issue Dec 4, 2020 · 0 comments
Open

Feature Proposal: Submodules on the same branch #401

jberaud opened this issue Dec 4, 2020 · 0 comments

Comments

@jberaud
Copy link

jberaud commented Dec 4, 2020

Due to our needs, I have implemented on our fork a feature which may be useful to some users. If there is some interest, I'll submit a PR here (after a bit of cleanup). Please see https://github.com/sasfermat/checkout/tree/fermat-submodules-branch.

The use case is quite common for the development workflows I have been using. Here is a description:

We have a parent repository and submodules. Quite often, changes happen in more than one submodule at once, in order to implement an overall API change for instance. When this happens, in order to be able to checkout all the changes to test at once, we decided to name all the branches on all the impacted submodules with the same name so that they are identifiable and implemented a way to tell the checkout action to checkout each submodule on a branch if it exists.

Implemented solution:
I have added an input called 'submodules-remote-branch' and the code checks on each submodule whether a branch with that name exists. In case it exists, the submodule is checked out of that branch.
In our pull request workflows, I set this input param to ${{ github.head_ref}} which leaves it empty for non PR.

I understand this may be a bit too specific for a generic action like 'checkout' but I'd rather propose it in case other people are interested.

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

1 participant