Skip to content

Copy branch protections #4

Closed

Description

@mheap

If you have any branch protections enabled on your current default branch, these will be lost (in fact, the tool might not work at all).

Proposed workflow:

  • Store current branch protections
  • Disable branch protections on old default branch
  • Enable branch protections on new default branch
  • Switch default branch
  • Delete old default branch

Activity

  1. foolip commented on Jun 15, 2020

    @foolip

    Note that the branch protection rule is a pattern, which I expect is very rarely used, but you should probably fail or warn if the pattern contains a *.

  2. gr2m commented on Jun 18, 2020

    @gr2m
    Contributor

    Here is what I do in octokit-plugin-rename-branch:

    https://github.com/gr2m/octokit-plugin-rename-branch/blob/5d3c37439515db9f49f049e28510dc596982cb02/src/rename-branch.ts#L56-L90

    The code looks for exact matches and updates it. It does not copy it, as that's out of scope for octokit-plugin-rename-branch

  3. added a commit that references this issue on Jun 18, 2020
    0fd0ccf
  4. added a commit that references this issue on Jun 18, 2020
    5012084
  5. gr2m commented on Jun 18, 2020

    @gr2m
    Contributor

    Thanks for the shout out :)

    I haven't used your CLI yet, but I think you have the feature to keep the previous branch around. So maybe it should not be an update of the pattern, but a copy of the settings?

  6. added a commit that references this issue on Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions