generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6e8a55
commit fe8542c
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` | ||
|
@@ -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) |