Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Dec 12, 2024
1 parent a6e8a55 commit fe8542c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/branch-rulesets.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Branch Rulesets

A ruleset is a named list of rules that applies to a repository. You can have up to 75 rulesets per repository. In this project specifically, we care about the rulesets that are applied to the default (stable) branch of a repository (most likely `main` or `master`).

You should absolutely enable rulesets on your default branch when using this Action. It can help protect your default branch from accidental or even malicious changes.

This project will actually warn you in the logs if you are missing or have misconfigured certain rulesets. The "warnings" section of this document will help you understand how to fix these warnings and enable robust rulesets to protect your repository.

It should be noted that if you have a good reason to *not* use any of these rulesets, and you want to disable to loud warnings in the logs, you can do so by setting the `use_security_warnings` input option to `false`. This will disable all warnings in the logs.

Example:

```yaml
- uses: github/[email protected]
id: branch-deploy
with:
use_security_warnings: false # <-- this will disable all warnings in the logs related to branch rulesets
```
## Warnings
### `missing_non_fast_forward`
Expand Down Expand Up @@ -49,3 +66,9 @@ Solution: Ensure that the **Required approvals** setting is not `0`
Solution: Enable the **Require deployments to succeed** rule

![missing_required_deployments](./assets/rules/missing_required_deployments.png)

## Extra Documentation

- [Learn about rulesets](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets)
- [Learn about repo rules in the API](https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28)
- [Learn about branch protection rules in the API](https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28)

0 comments on commit fe8542c

Please sign in to comment.