Skip to content

Commit fe8e664

Browse files
Update status check doc
Signed-off-by: Viacheslav Kudinov <[email protected]>
1 parent 849418a commit fe8e664

1 file changed

Lines changed: 39 additions & 3 deletions

File tree

website/docs/r/branch_protection.html.markdown

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,45 @@ The following arguments are supported:
112112
* `strict`: (Optional) Require branches to be up to date before merging. Defaults to `false`.
113113
* `contexts`: (Optional) The list of status checks to require in order to merge into this branch. No status checks are required by default.
114114

115-
~> Note: This attribute can contain multiple string patterns.
116-
If specified, usual value is the [job name](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idname). Otherwise, the [job id](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idname) is defaulted to.
117-
For workflows that use matrixes, append the matrix name to the value using the following pattern `(<matrix_value>[, <matrix_value>])`. Matrixes should be specified based on the order of matrix properties in the workflow file. See [GitHub Documentation]("https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#using-a-matrix-strategy") for more information.
115+
~> **Note:** This attribute can contain multiple string patterns.
116+
If specified, usual value is the [job name](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idname). Otherwise, the [job id](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_id) is defaulted to.
117+
118+
For example, given the following workflow:
119+
```yaml
120+
...
121+
jobs:
122+
build:
123+
name: Build and Test
124+
runs-on: ubuntu-latest
125+
steps:
126+
...
127+
test:
128+
runs-on: ubuntu-latest
129+
steps:
130+
...
131+
```
132+
The value to use in `contexts` would be either `Build and Test` or `build` for the first job, and `test` for the second job.
133+
134+
For workflows that use matrixes, append the matrix name to the value using the following pattern `(<matrix_value>[, <matrix_value>])`. Matrixes should be specified based on the order of matrix properties in the workflow file. See [GitHub Documentation](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job-variations?versionId=free-pro-team%40latest&productId=actions&restPage=how-tos%2Cwrite-workflows#adding-a-matrix-strategy-to-your-workflow-job) for more information.
135+
136+
For example, given the following workflow:
137+
```yaml
138+
jobs:
139+
example_matrix:
140+
strategy:
141+
matrix:
142+
version: [10, 12, 14]
143+
os: [ubuntu-latest, windows-latest]
144+
```
145+
The values to use in `contexts` would be any of the following six options:
146+
- `example_matrix (10, ubuntu-latest)`
147+
- `example_matrix (10, windows-latest)`
148+
- `example_matrix (12, ubuntu-latest)`
149+
- `example_matrix (12, windows-latest)`
150+
- `example_matrix (14, ubuntu-latest)`
151+
- `example_matrix (14, windows-latest)`
152+
or combinations thereof.
153+
118154
For workflows that use reusable workflows, the pattern is `<initial_workflow.jobs.job.[name/id]> / <reused-workflow.jobs.job.[name/id]>`. This can extend multiple levels.
119155

120156
### Required Pull Request Reviews

0 commit comments

Comments
 (0)