Skip to content

Commit e499570

Browse files
author
Martin Lopes
authored
Merge branch 'main' into patch-1
2 parents 7dfda1a + 470e3da commit e499570

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

content/actions/reference/events-that-trigger-workflows.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ on:
705705

706706
{% data reusables.webhooks.workflow_run_desc %}
707707

708+
{% data reusables.github-actions.branch-requirement %}
709+
708710
| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
709711
| --------------------- | -------------- | ------------ | -------------|
710712
| [`workflow_run`](/webhooks/event-payloads/#workflow_run) | - n/a | Last commit on default branch | Default branch |

content/actions/reference/workflow-syntax-for-github-actions.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ The name of the job displayed on {% data variables.product.prodname_dotcom %}.
249249

250250
### `jobs.<job_id>.needs`
251251

252-
Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional statement that causes the job to continue.
252+
Identifies any jobs that must complete successfully before this job will run. It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional expression that causes the job to continue.
253253

254-
#### Example
254+
#### Example requiring dependent jobs to be successful
255255

256256
```yaml
257257
jobs:
@@ -270,6 +270,20 @@ The jobs in this example run sequentially:
270270
2. `job2`
271271
3. `job3`
272272

273+
#### Example not requiring dependent jobs to be successful
274+
275+
```yaml
276+
jobs:
277+
job1:
278+
job2:
279+
needs: job1
280+
job3:
281+
if: always()
282+
needs: [job1, job2]
283+
```
284+
285+
In this example, `job3` uses the `always()` conditional expression so that it always runs after `job1` and `job2` have completed, regardless of whether they were successful. For more information, see "[Context and expression syntax](/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions)."
286+
273287
### `jobs.<job_id>.runs-on`
274288

275289
**Required** The type of machine to run the job on. The machine can be either a {% data variables.product.prodname_dotcom %}-hosted runner or a self-hosted runner.

0 commit comments

Comments
 (0)