You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/checks.md
+9-3
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Checks ✅
2
2
3
-
> This feature was originally requested via [#73](https://github.com/github/branch-deploy/issues/73) and further improved in [#321](https://github.com/github/branch-deploy/issues/321)
3
+
> This feature was originally requested via [#73](https://github.com/github/branch-deploy/issues/73) and further improved in [#321](https://github.com/github/branch-deploy/issues/321) and [#362](https://github.com/github/branch-deploy/issues/362)
4
4
5
5
The branch-deploy Action contains a useful input option to help give developers more control over how CI checks are handled during the deployment process. Some teams may have very strict controls over deployments and require **all status checks** to pass before a deployment can start. In this case, all CI checks must pass and that includes required, or non-required checks. Other teams may have a more relaxed approach and only require certain checks to pass before a deployment can start. This is where the `checks` input option comes in handy.
6
6
@@ -34,7 +34,7 @@ This example shows how you can use the `checks` option to require all CI checks
34
34
uses: github/[email protected]# replace with the latest version of this Action
35
35
id: branch-deploy
36
36
with:
37
-
checks: "all"# all CI checks (required or not) must pass before a deployment can start
37
+
checks: "all"# all CI checks (required or not) must pass before a deployment can start to any environment
38
38
```
39
39
40
40
### Example 2: Only Required CI Checks Must Pass
@@ -46,7 +46,7 @@ This example shows how you can use the `checks` option to require only the **req
46
46
uses: github/[email protected] # replace with the latest version of this Action
47
47
id: branch-deploy
48
48
with:
49
-
checks: "required" # only required CI checks must pass before a deployment can start
49
+
checks: "required" # only required CI checks must pass before a deployment can start to any environment
50
50
```
51
51
52
52
The screenshot below demonstrates how this option works in a real-world scenario. You can see how there are two CI checks defined on the pull request. One is called `test1` which is **required** and **passing**. The other is called `test2` which is **not required** and **failing**. Since the `checks` option is set to `required`, the deployment will start because the required check is passing and is the only status check taken into consideration for a deployment.
@@ -55,13 +55,19 @@ The screenshot below demonstrates how this option works in a real-world scenario
55
55
56
56
### Example 3: Only specific CI checks must pass (required or not)
57
57
58
+
If you only care about a specific CI check, you can use the `checks` option with a comma-separated list of checks that must pass. For example, if you only care about the `test1` check, you can do the following:
59
+
58
60
```yaml
59
61
- uses: github/[email protected] # replace with the latest version of this Action
60
62
id: branch-deploy
61
63
with:
62
64
checks: 'test1' # we only care about the check named `test1`
63
65
```
64
66
67
+
This will require that a CI check named `test1` must pass before a deployment (to any environment) can start. If the `test1` check is in any state other than **passing** (successful), the deployment will not start. This option will scan all CI checks (required or not) and only the checks that are specified in the `checks` option will be considered are blocking for deployment. If you have 10 failing CI checks, and only one passing check, and that check is the only one specified in the `checks` option, the deployment will start.
68
+
69
+
Please note that just because you can _deploy_, doesn't always mean you can merge. You should always review the configuration options of this Action and the branch protection (or ruleset) polices within your repository and ensure that they are configured to meet your team's requirements.
70
+
65
71
> If you project has a lot of CI tests, no worries! You could do `test1,test2,<etc>` to specify multiple checks that must pass.
0 commit comments