1
0
mirror of synced 2026-01-03 15:05:54 -05:00

Reintroduce branch_protection_rule actions trigger docs

(also nixes some trailing spaces)
This commit is contained in:
Carlos Duarte Do Nascimento (Chester)
2021-10-13 15:41:46 +00:00
committed by GitHub
parent d924a586e3
commit 2ea6970342

View File

@@ -62,7 +62,7 @@ Cron syntax has five fields separated by a space, and each field represents a un
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
│ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
* * * * *
@@ -89,7 +89,7 @@ Notifications for scheduled workflows are sent to the user who last modified the
## Manual events
You can manually trigger workflow runs. To trigger specific workflows in a repository, use the `workflow_dispatch` event. To trigger more than one workflow in a repository and create custom events and event types, use the `repository_dispatch` event.
You can manually trigger workflow runs. To trigger specific workflows in a repository, use the `workflow_dispatch` event. To trigger more than one workflow in a repository and create custom events and event types, use the `repository_dispatch` event.
### `workflow_dispatch`
@@ -190,6 +190,28 @@ You can configure your workflow to run when webhook events are generated on {% d
Not all webhook events trigger workflows. For the complete list of available webhook events and their payloads, see "[Webhook events and payloads](/developers/webhooks-and-events/webhook-events-and-payloads)."
{% ifversion fpt or ghes > 3.2 or ghae-next %}
### `branch_protection_rule`
Runs your workflow anytime the `branch_protection_rule` event occurs. {% data reusables.developer-site.multiple_activity_types %} For information about the GraphQL API, see "[BranchProtectionRule](/graphql/reference/objects#branchprotectionrule)."
{% data reusables.github-actions.branch-requirement %}
| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
| --------------------- | -------------- | ------------ | -------------|
| [`branch_protection_rule`](/webhooks/event-payloads/#branch_protection_rule) | - `created`<br/>- `edited`<br/>- `deleted` | Last commit on default branch | Default branch |
{% data reusables.developer-site.limit_workflow_to_activity_types %}
For example, you can run a workflow when a branch protection rule has been `created` or `deleted`.
```yaml
on:
branch_protection_rule:
types: [created, deleted]
```
{% endif %}
### `check_run`
Runs your workflow anytime the `check_run` event occurs. {% data reusables.developer-site.multiple_activity_types %} For information about the REST API, see "[Check runs](/rest/reference/checks#runs)."
@@ -589,7 +611,7 @@ Runs your workflow anytime the `pull_request` event occurs. {% data reusables.de
{% note %}
**Notes:**
**Notes:**
- By default, a workflow only runs when a `pull_request`'s activity type is `opened`, `synchronize`, or `reopened`. To trigger workflows for more activity types, use the `types` keyword.
- Workflows will not run on `pull_request` activity if the pull request has a merge conflict. The merge conflict must be resolved first.
@@ -808,7 +830,7 @@ on:
workflow_run:
workflows: ["Run Tests"]
branches: [main]
types:
types:
- completed
- requested
```