diff --git a/content/actions/reference/workflow-syntax-for-github-actions.md b/content/actions/reference/workflow-syntax-for-github-actions.md index dcfa3af305fe..863f1adadae3 100644 --- a/content/actions/reference/workflow-syntax-for-github-actions.md +++ b/content/actions/reference/workflow-syntax-for-github-actions.md @@ -249,9 +249,9 @@ The name of the job displayed on {% data variables.product.prodname_dotcom %}. ### `jobs..needs` -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. +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. -#### Example +#### Example requiring dependent jobs to be successful ```yaml jobs: @@ -270,6 +270,20 @@ The jobs in this example run sequentially: 2. `job2` 3. `job3` +#### Example not requiring dependent jobs to be successful + +```yaml +jobs: + job1: + job2: + needs: job1 + job3: + if: always() + needs: [job1, job2] +``` + +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)." + ### `jobs..runs-on` **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.