0 votes
in GitHub by
Explain about events that trigger workflows in gitHub?

1 Answer

0 votes
by

You can configure your workflows to run when specific activity on GitHub happens, at a scheduled time, or when an event outside of GitHub occurs.

Workflow triggers are events that cause a workflow to run. Some events have multiple activity types. For these events, you can specify which activity types will trigger a workflow run. 

branch_protection_rule

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
branch_protection_rule- created
- edited
- deleted
Last commit on default branchDefault branch










 

Runs your workflow when branch protection rules in the workflow repository are changed. For more information about branch protection rules, see "About protected branches." For information about the branch protection rule APIs

For example, you can run a workflow when a branch protection rule has been created or deleted:

on:
  branch_protection_rule:
    types: [created, deleted]

check_run

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
check_run- created
- rerequested
- completed
- requested_action
Last commit on default branchDefault branch






 

Runs your workflow when activity related to a check run occurs. A check run is an individual test that is part of a check suite.

For example, you can run a workflow when a check run has been rerequested or completed.

on:
  check_run:
    types: [rerequested, completed]

check_suite

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
check_suite- completedLast commit on default branchDefault branch

Runs your workflow when check suite activity occurs. A check suite is a collection of the check runs created for a specific commit. Check suites summarize the status and conclusion of the check runs that are in the suite. 

For example, you can run a workflow when a check suite has been completed.

on:
  check_suite:
    types: [completed]

create

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
createNot applicableLast commit on the created branch or tagBranch or tag created

Note: An event will not be created when you create more than three tags at once.

Runs your workflow when someone creates a Git reference (Git branch or tag) in the workflow's repository. 

For example, you can run a workflow when the create event occurs.

on:
  create

delete

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
deleteNot applicableLast commit on default branchDefault branch

Note: This event will only trigger a workflow run if the workflow file is on the default branch.

Note: An event will not be created when you delete more than three tags at once.

Runs your workflow when someone deletes a Git reference (Git branch or tag) in the workflow's repository.

deployment

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
deploymentNot applicableCommit to be deployedBranch or tag to be deployed (empty if created with a commit SHA)

Runs your workflow when someone creates a deployment in the workflow's repository. Deployments created with a commit SHA may not have a Git ref. For information about the APIs to create a deployment.

deployment_status

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
deployment_statusNot applicableCommit to be deployedBranch or tag to be deployed (empty if commit)

Note: When a deployment status's state is set to inactive, a workflow run will not be triggered.

Runs your workflow when a third party provides a deployment status. Deployments created with a commit SHA may not have a Git ref. 

discussion

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
discussion- created
- edited
- deleted
- transferred
- pinned
- unpinned
- labeled
- unlabeled
- locked
- unlocked
- category_changed
- answered
- unanswered
Last commit on default branchDefault branch
 

Runs your workflow when a discussion in the workflow's repository is created or modified. For activity related to comments on a discussion.

discussion_comment

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
discussion_comment- created
- edited
- deleted
Last commit on default branchDefault branch

Runs your workflow when a comment on a discussion in the workflow's repository is created or modified. 

fork

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
forkNot applicableLast commit on default branchDefault branch

Note: This event will only trigger a workflow run if the workflow file is on the default branch.

Runs your workflow when someone forks a repository.

gollum

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
gollumNot applicableLast commit on default branchDefault branch

Note: This event will only trigger a workflow run if the workflow file is on the default branch.

Runs your workflow when someone creates or updates a Wiki page.

issue_comment

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
issue_comment- created
- edited
- deleted
Last commit on default branchDefault branch

Note: More than one activity type triggers this event. For information about each activity type, see "Webhook events and payloads." By default, all activity types trigger workflows that run on this event. You can limit your workflow runs to specific activity types using the types keyword. For more information, see "Workflow syntax for GitHub Actions."

Note: This event will only trigger a workflow run if the workflow file is on the default branch.

Runs your workflow when an issue or pull request comment is created, edited, or deleted. For information about the issue comment APIs

...