Skip to content

Feature Proposal: Submodules on the same branch #401

Open
@jberaud

Description

@jberaud

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions