{"id":47183,"date":"2024-10-04T06:05:06","date_gmt":"2024-10-04T06:05:06","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=47183"},"modified":"2024-10-04T06:05:06","modified_gmt":"2024-10-04T06:05:06","slug":"github-actioon-list-of-events-that-trigger-workflows","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/github-actioon-list-of-events-that-trigger-workflows\/","title":{"rendered":"Github Actioon: List of Events that trigger workflows"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><strong>GitHub Actions Events Table<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Event<\/strong><\/th><th><strong>Description<\/strong><\/th><th><strong>Common Use Cases<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong><code>push<\/code><\/strong><\/td><td>Triggered when commits are pushed to a repository branch.<\/td><td>Run CI builds, deploy code, run tests, or linting after code is pushed to a branch.<\/td><\/tr><tr><td><strong><code>pull_request<\/code><\/strong><\/td><td>Triggered when a pull request is opened, synchronized, or closed.<\/td><td>Run tests, build previews, and lint code when a pull request is created or updated.<\/td><\/tr><tr><td><strong><code>pull_request_review<\/code><\/strong><\/td><td>Triggered when someone submits a review to a pull request.<\/td><td>Notify team members or run workflows based on PR reviews.<\/td><\/tr><tr><td><strong><code>pull_request_review_comment<\/code><\/strong><\/td><td>Triggered when a comment is added to a pull request review.<\/td><td>Automate responses or actions based on review comments on pull requests.<\/td><\/tr><tr><td><strong><code>workflow_dispatch<\/code><\/strong><\/td><td>Allows manually triggering a workflow via the GitHub Actions interface.<\/td><td>Trigger workflows manually, often used for custom workflows like deployments or tests.<\/td><\/tr><tr><td><strong><code>schedule<\/code><\/strong><\/td><td>Triggered based on a cron schedule (e.g., daily, weekly).<\/td><td>Run periodic tasks like nightly builds, backups, or maintenance tasks.<\/td><\/tr><tr><td><strong><code>release<\/code><\/strong><\/td><td>Triggered when a release is published, edited, or deleted.<\/td><td>Automatically deploy, notify teams, or create release notes when a new release is created.<\/td><\/tr><tr><td><strong><code>issue_comment<\/code><\/strong><\/td><td>Triggered when a comment is added to an issue or pull request.<\/td><td>Respond to comments, automate issue management, or trigger builds\/tests based on comments.<\/td><\/tr><tr><td><strong><code>issues<\/code><\/strong><\/td><td>Triggered when an issue is opened, edited, labeled, or closed.<\/td><td>Automate issue triaging, labeling, or closing stale issues.<\/td><\/tr><tr><td><strong><code>create<\/code><\/strong><\/td><td>Triggered when a branch or tag is created.<\/td><td>Notify teams, or trigger CI\/CD workflows when new branches\/tags are created.<\/td><\/tr><tr><td><strong><code>delete<\/code><\/strong><\/td><td>Triggered when a branch or tag is deleted.<\/td><td>Clean up resources or notify teams when a branch or tag is removed.<\/td><\/tr><tr><td><strong><code>fork<\/code><\/strong><\/td><td>Triggered when a repository is forked.<\/td><td>Send a notification or log repository forks for tracking.<\/td><\/tr><tr><td><strong><code>star<\/code><\/strong><\/td><td>Triggered when a repository is starred or unstarred.<\/td><td>Send a thank-you message or track the repository\u2019s popularity.<\/td><\/tr><tr><td><strong><code>watch<\/code><\/strong><\/td><td>Triggered when someone starts watching the repository.<\/td><td>Notify maintainers or track the repository&#8217;s watchers.<\/td><\/tr><tr><td><strong><code>public<\/code><\/strong><\/td><td>Triggered when a repository is made public.<\/td><td>Notify teams or trigger security workflows when a repository\u2019s visibility changes.<\/td><\/tr><tr><td><strong><code>workflow_run<\/code><\/strong><\/td><td>Triggered by the completion of another workflow.<\/td><td>Chain workflows together, such as triggering deployments after a successful test run.<\/td><\/tr><tr><td><strong><code>workflow_call<\/code><\/strong><\/td><td>Triggered when a reusable workflow is called from another workflow.<\/td><td>Allows reusability of workflows across repositories.<\/td><\/tr><tr><td><strong><code>status<\/code><\/strong><\/td><td>Triggered when the status of a GitHub check run changes (e.g., success, failure).<\/td><td>Notify teams or execute follow-up actions based on the status of previous checks.<\/td><\/tr><tr><td><strong><code>check_run<\/code><\/strong><\/td><td>Triggered when a check run (e.g., CI test) is created, completed, or updated.<\/td><td>Trigger workflows based on the results of automated checks.<\/td><\/tr><tr><td><strong><code>check_suite<\/code><\/strong><\/td><td>Triggered when a check suite (collection of check runs) is requested or completed.<\/td><td>Perform actions based on the aggregate results of check suites.<\/td><\/tr><tr><td><strong><code>repository_dispatch<\/code><\/strong><\/td><td>Triggered when an external service or another workflow sends a <code>repository_dispatch<\/code> event.<\/td><td>Trigger workflows from external systems or via API requests.<\/td><\/tr><tr><td><strong><code>deployment<\/code><\/strong><\/td><td>Triggered when a deployment is created.<\/td><td>Automate deployment processes like deploying applications or setting up infrastructure.<\/td><\/tr><tr><td><strong><code>deployment_status<\/code><\/strong><\/td><td>Triggered when a deployment status is updated (e.g., success, failure).<\/td><td>Perform actions like rollback or notification based on the outcome of a deployment.<\/td><\/tr><tr><td><strong><code>pull_request_target<\/code><\/strong><\/td><td>Triggered for pull requests targeting the repository, but runs in the context of the base branch.<\/td><td>Useful for workflows involving forked repositories, maintaining security while allowing PR contributions.<\/td><\/tr><tr><td><strong><code>branch_protection_rule<\/code><\/strong><\/td><td>Triggered when a branch protection rule is added, edited, or deleted.<\/td><td>Monitor or enforce branch protection changes.<\/td><\/tr><tr><td><strong><code>discussion<\/code><\/strong><\/td><td>Triggered when a discussion is created, edited, or deleted.<\/td><td>Automate discussion management, notify teams, or categorize discussions.<\/td><\/tr><tr><td><strong><code>discussion_comment<\/code><\/strong><\/td><td>Triggered when a comment is added to a discussion.<\/td><td>Automate responses or notifications based on discussion comments.<\/td><\/tr><tr><td><strong><code>repository_vulnerability_alert<\/code><\/strong><\/td><td>Triggered when GitHub detects a security vulnerability in the repository.<\/td><td>Automate security workflows, patch dependencies, or notify security teams.<\/td><\/tr><tr><td><strong><code>package<\/code><\/strong><\/td><td>Triggered when a package is published or updated.<\/td><td>Automate tasks like deployment or testing when a new package is released.<\/td><\/tr><tr><td><strong><code>push_tag<\/code><\/strong><\/td><td>Triggered when a tag is pushed to the repository.<\/td><td>Use for versioning, release automation, or CI based on tagging.<\/td><\/tr><tr><td><strong><code>milestone<\/code><\/strong><\/td><td>Triggered when a milestone is created, edited, or closed.<\/td><td>Automate milestone tracking or notify teams of milestone progress.<\/td><\/tr><tr><td><strong><code>label<\/code><\/strong><\/td><td>Triggered when a label is created, edited, or deleted.<\/td><td>Automate label management for issues and pull requests.<\/td><\/tr><tr><td><strong><code>registry_package<\/code><\/strong><\/td><td>Triggered when a registry package is published, updated, or deleted.<\/td><td>Manage or monitor changes in packages stored in GitHub\u2019s registry.<\/td><\/tr><tr><td><strong><code>page_build<\/code><\/strong><\/td><td>Triggered when a GitHub Pages site build completes.<\/td><td>Automate tasks like notifying teams or triggering follow-up actions after a site is built.<\/td><\/tr><tr><td><strong><code>member<\/code><\/strong><\/td><td>Triggered when a user is added, removed, or invited to a repository.<\/td><td>Automate onboarding or offboarding workflows for team members.<\/td><\/tr><tr><td><strong><code>team<\/code><\/strong><\/td><td>Triggered when a team is added, modified, or deleted.<\/td><td>Automate team management workflows.<\/td><\/tr><tr><td><strong><code>workflow_call<\/code><\/strong><\/td><td>Triggered when another workflow calls a reusable workflow.<\/td><td>Useful for creating reusable workflows that can be invoked by multiple workflows.<\/td><\/tr><tr><td><strong><code>secret_scanning_alert<\/code><\/strong><\/td><td>Triggered when GitHub identifies sensitive data in the repository.<\/td><td>Automatically notify security teams or handle leaked secrets.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explanation of Key Events<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>push<\/code><\/strong>: This is one of the most commonly used events, triggering workflows when commits are pushed to a specific branch.<\/li>\n\n\n\n<li><strong><code>pull_request<\/code><\/strong>: Triggered whenever a pull request is opened, updated, or merged. It&#8217;s useful for running CI\/CD pipelines based on pull requests.<\/li>\n\n\n\n<li><strong><code>workflow_dispatch<\/code><\/strong>: This allows manual triggering of workflows, useful for scenarios like manually starting a deployment.<\/li>\n\n\n\n<li><strong><code>schedule<\/code><\/strong>: Allows workflows to run at specific times using cron syntax. Useful for nightly builds or periodic maintenance tasks.<\/li>\n\n\n\n<li><strong><code>release<\/code><\/strong>: Used to trigger workflows when a new release is created. This is often used for deployment workflows.<\/li>\n\n\n\n<li><strong><code>check_run<\/code> \/ <code>check_suite<\/code><\/strong>: These events are triggered when automated checks (like CI tests) complete or fail. Actions can be taken based on the results.<\/li>\n\n\n\n<li><strong><code>deployment<\/code> \/ <code>deployment_status<\/code><\/strong>: Automate the deployment process when a new deployment is created or monitor the deployment status to handle rollback or notification.<\/li>\n\n\n\n<li><strong><code>repository_dispatch<\/code><\/strong>: Trigger workflows from external services or systems using the GitHub API.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Example<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/0bd2f0f20de20baf2f26526c2e0f733e.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>GitHub Actions Events Table Event Description Common Use Cases push Triggered when commits are pushed to a repository branch. Run CI builds, deploy code, run tests, or linting after code&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-47183","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=47183"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47183\/revisions"}],"predecessor-version":[{"id":47184,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47183\/revisions\/47184"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=47183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=47183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=47183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}