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

New command to automate setting "Protected branch" on github to prevent force push #9878

Closed
wants to merge 1 commit into from

Conversation

mattab
Copy link
Member

@mattab mattab commented Mar 5, 2016

This is a new simple command that automates setting, for all repository for which there is admin access, the master branch as protected, which means "git forced pushes" will be disabled. This prevents someone mistakenly rewriting the git history.

As more people get write access to more repositories, it becomes more important to follow best practises for git repository security. One can run this tool regularly to ensure all our one's repos are protected.

@mattab mattab added the Needs Review PRs that need a code review label Mar 5, 2016
@mattab mattab added this to the 2.16.1 milestone Mar 5, 2016
@sgiehl
Copy link
Member

sgiehl commented Mar 5, 2016

Not directly related to this PR but shouldn't we maybe move scripts like that to an "internal" plugin that would be linked as a submodule but would not available on marketplace?

I don't see any sense in having them in this repo.

@tsteur
Copy link
Member

tsteur commented Mar 6, 2016

I was just about to comment the same. This should be definitely not in Piwik repo. Maybe you can add this to plugin lifecycle etc? Run the command once to change them all and make sure new repos will have a protected branch automatically.

@tsteur tsteur closed this Mar 6, 2016
@mattab mattab deleted the force_push branch March 15, 2016 00:21
@mattab
Copy link
Member Author

mattab commented Mar 31, 2016

It would be useful to extend this command to also force the users who are allowed to push to given branches (ie. lead developers / product owners only would be allowed to merge a given PR). https://github.com/blog/2137-protected-branches-improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants