Skip to content

Commit 90d7176

Browse files
authored
EDI-ify "Canceling a workflow" (#56787)
1 parent 8d6e215 commit 90d7176

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed
Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
---
22
title: Canceling a workflow
33
shortTitle: Cancel a workflow
4-
intro: 'You can cancel a workflow run that is in progress. When you cancel a workflow run, {% data variables.product.prodname_dotcom %} cancels all jobs and steps that are a part of that workflow.'
4+
intro: 'You can cancel a workflow run, including all jobs and steps, that is in progress.'
55
versions:
66
fpt: '*'
77
ghes: '*'
88
ghec: '*'
9+
permissions: '{% data reusables.repositories.permissions-statement-write %}'
910
redirect_from:
1011
- /actions/managing-workflow-runs/canceling-a-workflow
1112
- /actions/managing-workflow-runs-and-deployments/managing-workflow-runs/canceling-a-workflow
1213
---
1314

14-
{% data reusables.actions.enterprise-github-hosted-runners %}
15-
16-
{% data reusables.repositories.permissions-statement-write %}
17-
1815
## Canceling a workflow run
1916

2017
{% data reusables.repositories.navigate-to-repo %}
@@ -24,12 +21,6 @@ redirect_from:
2421
1. In the upper-right corner of the workflow, click **Cancel workflow**.
2522
![Screenshot showing the summary for a workflow that is currently running. The "Cancel workflow" button is highlighted with a dark orange outline.](/assets/images/help/repository/cancel-check-suite-updated.png)
2623

27-
## Steps {% data variables.product.prodname_dotcom %} takes to cancel a workflow run
28-
29-
When canceling workflow run, you may be running other software that uses resources that are related to the workflow run. To help you free up resources related to the workflow run, it may help to understand the steps {% data variables.product.prodname_dotcom %} performs to cancel a workflow run.
24+
## Next steps
3025

31-
1. To cancel the workflow run, the server re-evaluates `if` conditions for all currently running jobs. If the condition evaluates to `true`, the job will not get canceled. For example, the condition `if: always()` would evaluate to true and the job continues to run. When there is no condition, that is the equivalent of the condition `if: success()`, which only runs if the previous step finished successfully.
32-
1. For jobs that need to be canceled, the server sends a cancellation message to all the runner machines with jobs that need to be canceled.
33-
1. For jobs that continue to run, the server re-evaluates `if` conditions for the unfinished steps. If the condition evaluates to `true`, the step continues to run. You can use the `cancelled` expression to apply a status check of `cancelled()`. For more information see [AUTOTITLE](/actions/learn-github-actions/expressions#cancelled).
34-
1. For steps that need to be canceled, the runner machine sends `SIGINT/Ctrl-C` to the step's entry process (`node` for javascript action, `docker` for container action, and `bash/cmd/pwd` when using `run` in a step). If the process doesn't exit within 7500 ms, the runner will send `SIGTERM/Ctrl-Break` to the process, then wait for 2500 ms for the process to exit. If the process is still running, the runner kills the process tree.
35-
1. After the 5 minutes cancellation timeout period, the server will force terminate all jobs and steps that don't finish running or fail to complete the cancellation process.
26+
To learn about the process {% data variables.product.prodname_dotcom %} uses to cancel a workflow run, as well as the ways you can free up related resources, see [AUTOTITLE](/actions/reference/workflow-cancellation-reference).

content/actions/reference/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ children:
2727
- /self-hosted-runners-reference
2828
- /supplemental-arguments-and-settings
2929
- /extending-github-actions-importer-with-custom-transformers
30+
- /workflow-cancellation-reference
3031
---
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Workflow cancellation reference
3+
shortTitle: Workflow cancellation reference
4+
intro: Find information on the steps {% data variables.product.prodname_dotcom %} takes to cancel a workflow run.
5+
versions:
6+
fpt: '*'
7+
ghes: '*'
8+
ghec: '*'
9+
---
10+
11+
When canceling a workflow run, you may be running other software that uses resources related to the workflow run. To help you free up resources related to the workflow run, it may help to understand the steps {% data variables.product.prodname_dotcom %} performs to cancel a workflow run.
12+
13+
1. To cancel the workflow run, the server re-evaluates `if` conditions for all currently running jobs. If the condition evaluates to `true`, the job will not get canceled. For example, the condition `if: always()` would evaluate to true and the job continues to run. When there is no condition, that is the equivalent of the condition `if: success()`, which only runs if the previous step finished successfully.
14+
1. For jobs that need to be canceled, the server sends a cancellation message to all the runner machines with jobs that need to be canceled.
15+
1. For jobs that continue to run, the server re-evaluates `if` conditions for the unfinished steps. If the condition evaluates to `true`, the step continues to run. You can use the `cancelled` expression to apply a status check of `cancelled()`. For more information, see [AUTOTITLE](/actions/reference/evaluate-expressions-in-workflows-and-actions#cancelled).
16+
1. For steps that need to be canceled, the runner machine sends `SIGINT/Ctrl-C` to the step's entry process (`node` for JavaScript actions, `docker` for container actions, and `bash/cmd/pwd` when using `run` in a step). If the process doesn't exit within 7500 ms, the runner will send `SIGTERM/Ctrl-Break` to the process, then wait for 2500 ms for the process to exit. If the process is still running, the runner kills the process tree.
17+
1. After the 5 minute cancellation timeout period, the server will forcibly terminate all jobs and steps that are still running.

0 commit comments

Comments
 (0)