BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

Main branch is not protected because of the GH Action needs to write

Open eddiejaoude opened this issue 2 years ago • 6 comments

Description

The default branch main should be protected but for the Actions that need to write to main this is a problem

What are the solutions?

Screenshots

No response

Additional information

No response

eddiejaoude avatar Jan 06 '23 08:01 eddiejaoude

It's great having you contribute to this project

Welcome to the community :nerd_face:

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord chat and our GitHub Organisation - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.

github-actions[bot] avatar Jan 06 '23 08:01 github-actions[bot]

Looks like it's not 100% possible yet, I guess? https://github.com/orgs/community/discussions/25305

Panquesito7 avatar Jan 06 '23 15:01 Panquesito7

Seems like an exception needs to be made in the branch protection rules. https://github.blog/changelog/2021-11-19-allow-bypassing-required-pull-requests/

ad3rinto avatar Jan 06 '23 17:01 ad3rinto

Seems like an exception needs to be made in the branch protection rules. https://github.blog/changelog/2021-11-19-allow-bypassing-required-pull-requests/

Yeah, but I'm not sure the actions user can be added. And if it can be added, it can be dangerous to use (see https://github.com/orgs/community/discussions/25305#discussioncomment-3247405).

Panquesito7 avatar Jan 06 '23 20:01 Panquesito7

Yes, no exception should be made in order to allow the actions user to push to protected branches, because this allows for other loopholes to appear.

Apparently, releases.yml and prettier.yml need to be adjusted.

I'll create a draft tomorrow. It might be useful to know the desired protection settings for the main branch, so we know the exact restrictions @eddiejaoude

mocdaniel avatar Jan 06 '23 21:01 mocdaniel

Thanks everyone for your help on this 💪

I think the main rule should be Require a pull request before merging this stops anyone by mistake (especially me 😂 ) accidentally pushing to the main branch and breaking production

eddiejaoude avatar Jan 06 '23 22:01 eddiejaoude