|
| 1 | +# Deployment Confirmation |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +For projects that require the highest level of deployment safety/security, the branch-deploy Action can be configured to require a deployment **confirmation** before a deployment is allowed to proceed. |
| 6 | + |
| 7 | +This can be considered a "final safety check" before a deployment can continue. |
| 8 | + |
| 9 | +By using this feature, it is also an extremely effective way to prevent accidental or malicious commits from being deployed without first having one last safety review. This is important for hardening against Actions related [TOCTOU](https://github.com/AdnaneKhan/ActionsTOCTOU) vulnerabilities. |
| 10 | +## How it works |
| 11 | + |
| 12 | +When a user invokes a deployment via the `.deploy` (or `.noop`) command, the branch-deploy Action will pause _just_ before the final call to start a deployment by this Action. The Action will then create a new comment on the pull request that invoked the deployment, asking the user to confirm (or reject) the deployment. |
| 13 | + |
| 14 | +This comment will provide the user with a summary of the deployment that is **about** to be run. The user will then have the opportunity to confirm (with a 👍) or deny (with a 👎) the deployment. |
| 15 | + |
| 16 | +Depending on the user's response (or lack of response), the branch-deploy Action will update the comment with the outcome. |
| 17 | + |
| 18 | +The only reaction (👍 or 👎) that will be considered is the first reaction from the original actor that invoked the deployment (via `.deploy`). For example, if `@monalisa` comments `.deploy`, only `@monalisa` can give deployment confirmation via a reaction. All other reactions will be ignored on the deployment confirmation comment. |
| 19 | + |
| 20 | +### Usage |
| 21 | + |
| 22 | +```yaml |
| 23 | + |
| 24 | + id: branch-deploy |
| 25 | + with: |
| 26 | + trigger: ".deploy" |
| 27 | + deployment_confirmation: true # <-- enables deployment confirmation |
| 28 | + deployment_confirmation_timeout: 60 # <-- sets the timeout to 60 seconds |
| 29 | +``` |
| 30 | +
|
| 31 | +### Confirming a Deployment 👍 |
| 32 | +
|
| 33 | +If the user confirms the deployment, the deployment will proceed as normal: |
| 34 | +
|
| 35 | + |
| 36 | +
|
| 37 | +### Rejecting a Deployment 👎 |
| 38 | +
|
| 39 | +If the user rejects the deployment, the branch-deploy Action will immediately exit and the `continue` output will not be set to `true`. This will prevent the deployment from proceeding. |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +### Timing Out 🕒 |
| 44 | + |
| 45 | +If the user does not respond within a set amount of time (configurable, but defaults to 1 minute), the deployment will be automatically rejected. The user will be notified of this outcome. |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +## Demo 📹 |
| 50 | + |
| 51 | +View a [demo video](https://github.com/github/branch-deploy/pull/374) of a deployment confirmation in action on the original pull request that introduced this feature. |
0 commit comments