From cecda2a163fdd37cad0156bddfbda17db5a603fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 14 Dec 2020 06:09:33 +0100 Subject: [PATCH 1/2] Add `needs:` syntax example using `always()` condition (#1307) Co-authored-by: Lucas Costi --- .../workflow-syntax-for-github-actions.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/content/actions/reference/workflow-syntax-for-github-actions.md b/content/actions/reference/workflow-syntax-for-github-actions.md index dcfa3af305..863f1adada 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. From 470e3da2314f7e610d353020fefc4585a9f9721e Mon Sep 17 00:00:00 2001 From: Lucas Costi Date: Mon, 14 Dec 2020 15:37:53 +1000 Subject: [PATCH 2/2] Add default branch note to workflow_run event (#2062) --- content/actions/reference/events-that-trigger-workflows.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/actions/reference/events-that-trigger-workflows.md b/content/actions/reference/events-that-trigger-workflows.md index 74c96bf349..0b05f29846 100644 --- a/content/actions/reference/events-that-trigger-workflows.md +++ b/content/actions/reference/events-that-trigger-workflows.md @@ -699,6 +699,8 @@ on: {% data reusables.webhooks.workflow_run_desc %} +{% data reusables.github-actions.branch-requirement %} + | Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` | | --------------------- | -------------- | ------------ | -------------| | [`workflow_run`](/webhooks/event-payloads/#workflow_run) | - n/a | Last commit on default branch | Default branch |