🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Github Actioon: List of Events that trigger workflows

GitHub Actions Events Table

EventDescriptionCommon Use Cases
pushTriggered when commits are pushed to a repository branch.Run CI builds, deploy code, run tests, or linting after code is pushed to a branch.
pull_requestTriggered when a pull request is opened, synchronized, or closed.Run tests, build previews, and lint code when a pull request is created or updated.
pull_request_reviewTriggered when someone submits a review to a pull request.Notify team members or run workflows based on PR reviews.
pull_request_review_commentTriggered when a comment is added to a pull request review.Automate responses or actions based on review comments on pull requests.
workflow_dispatchAllows manually triggering a workflow via the GitHub Actions interface.Trigger workflows manually, often used for custom workflows like deployments or tests.
scheduleTriggered based on a cron schedule (e.g., daily, weekly).Run periodic tasks like nightly builds, backups, or maintenance tasks.
releaseTriggered when a release is published, edited, or deleted.Automatically deploy, notify teams, or create release notes when a new release is created.
issue_commentTriggered when a comment is added to an issue or pull request.Respond to comments, automate issue management, or trigger builds/tests based on comments.
issuesTriggered when an issue is opened, edited, labeled, or closed.Automate issue triaging, labeling, or closing stale issues.
createTriggered when a branch or tag is created.Notify teams, or trigger CI/CD workflows when new branches/tags are created.
deleteTriggered when a branch or tag is deleted.Clean up resources or notify teams when a branch or tag is removed.
forkTriggered when a repository is forked.Send a notification or log repository forks for tracking.
starTriggered when a repository is starred or unstarred.Send a thank-you message or track the repository’s popularity.
watchTriggered when someone starts watching the repository.Notify maintainers or track the repository’s watchers.
publicTriggered when a repository is made public.Notify teams or trigger security workflows when a repository’s visibility changes.
workflow_runTriggered by the completion of another workflow.Chain workflows together, such as triggering deployments after a successful test run.
workflow_callTriggered when a reusable workflow is called from another workflow.Allows reusability of workflows across repositories.
statusTriggered when the status of a GitHub check run changes (e.g., success, failure).Notify teams or execute follow-up actions based on the status of previous checks.
check_runTriggered when a check run (e.g., CI test) is created, completed, or updated.Trigger workflows based on the results of automated checks.
check_suiteTriggered when a check suite (collection of check runs) is requested or completed.Perform actions based on the aggregate results of check suites.
repository_dispatchTriggered when an external service or another workflow sends a repository_dispatch event.Trigger workflows from external systems or via API requests.
deploymentTriggered when a deployment is created.Automate deployment processes like deploying applications or setting up infrastructure.
deployment_statusTriggered when a deployment status is updated (e.g., success, failure).Perform actions like rollback or notification based on the outcome of a deployment.
pull_request_targetTriggered for pull requests targeting the repository, but runs in the context of the base branch.Useful for workflows involving forked repositories, maintaining security while allowing PR contributions.
branch_protection_ruleTriggered when a branch protection rule is added, edited, or deleted.Monitor or enforce branch protection changes.
discussionTriggered when a discussion is created, edited, or deleted.Automate discussion management, notify teams, or categorize discussions.
discussion_commentTriggered when a comment is added to a discussion.Automate responses or notifications based on discussion comments.
repository_vulnerability_alertTriggered when GitHub detects a security vulnerability in the repository.Automate security workflows, patch dependencies, or notify security teams.
packageTriggered when a package is published or updated.Automate tasks like deployment or testing when a new package is released.
push_tagTriggered when a tag is pushed to the repository.Use for versioning, release automation, or CI based on tagging.
milestoneTriggered when a milestone is created, edited, or closed.Automate milestone tracking or notify teams of milestone progress.
labelTriggered when a label is created, edited, or deleted.Automate label management for issues and pull requests.
registry_packageTriggered when a registry package is published, updated, or deleted.Manage or monitor changes in packages stored in GitHub’s registry.
page_buildTriggered when a GitHub Pages site build completes.Automate tasks like notifying teams or triggering follow-up actions after a site is built.
memberTriggered when a user is added, removed, or invited to a repository.Automate onboarding or offboarding workflows for team members.
teamTriggered when a team is added, modified, or deleted.Automate team management workflows.
workflow_callTriggered when another workflow calls a reusable workflow.Useful for creating reusable workflows that can be invoked by multiple workflows.
secret_scanning_alertTriggered when GitHub identifies sensitive data in the repository.Automatically notify security teams or handle leaked secrets.

Explanation of Key Events

  1. push: This is one of the most commonly used events, triggering workflows when commits are pushed to a specific branch.
  2. pull_request: Triggered whenever a pull request is opened, updated, or merged. It’s useful for running CI/CD pipelines based on pull requests.
  3. workflow_dispatch: This allows manual triggering of workflows, useful for scenarios like manually starting a deployment.
  4. schedule: Allows workflows to run at specific times using cron syntax. Useful for nightly builds or periodic maintenance tasks.
  5. release: Used to trigger workflows when a new release is created. This is often used for deployment workflows.
  6. check_run / check_suite: These events are triggered when automated checks (like CI tests) complete or fail. Actions can be taken based on the results.
  7. deployment / deployment_status: Automate the deployment process when a new deployment is created or monitor the deployment status to handle rollback or notification.
  8. repository_dispatch: Trigger workflows from external services or systems using the GitHub API.

Example

name: Complete GitHub Actions Event Workflow
# Triggers (events) for the workflow
on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, closed]
workflow_dispatch: # Manual trigger
schedule:
- cron: "0 0 * * *" # Runs daily at midnight
release:
types: [published, edited]
issues:
types: [opened, closed, labeled]
issue_comment:
types: [created, edited]
deployment:
deployment_status:
pull_request_review:
pull_request_review_comment:
create:
delete:
discussion:
types: [created, edited]
discussion_comment:
types: [created, edited]
repository_dispatch:
check_run:
types: [completed]
check_suite:
types: [completed]
workflow_run:
workflows: ["CI Workflow"]
types:
- completed
registry_package:
types: [published, updated]
milestone:
types: [created, closed]
label:
types: [created, deleted]
star:
fork:
member:
team:
repository_vulnerability_alert:
secret_scanning_alert:
public:
jobs:
example_job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log Event Type
run: echo "Event Triggered: ${{ github.event_name }}"
- name: Run on Push
if: github.event_name == 'push'
run: echo "This action was triggered by a push event."
- name: Run on Pull Request
if: github.event_name == 'pull_request'
run: echo "This action was triggered by a pull request."
- name: Run on Issue Comment
if: github.event_name == 'issue_comment'
run: echo "This action was triggered by a comment on an issue or PR."
- name: Run on Release
if: github.event_name == 'release'
run: echo "This action was triggered by a release event."
- name: Run on Schedule
if: github.event_name == 'schedule'
run: echo "This action is running on schedule (cron job)."
- name: Run on Deployment
if: github.event_name == 'deployment'
run: echo "This action was triggered by a deployment event."
- name: Run on Discussion Created
if: github.event_name == 'discussion'
run: echo "This action was triggered by a discussion."
- name: Run on Check Completion
if: github.event_name == 'check_run' || github.event_name == 'check_suite'
run: echo "This action was triggered by a check run or check suite completion."
- name: Run on Workflow Dispatch
if: github.event_name == 'workflow_dispatch'
run: echo "This action was manually triggered."
- name: Run on Repository Dispatch
if: github.event_name == 'repository_dispatch'
run: echo "This action was triggered by an external repository dispatch."
- name: Run on Star or Fork
if: github.event_name == 'star' || github.event_name == 'fork'
run: echo "This action was triggered by a star or fork."
- name: Run on Secret Scanning Alert
if: github.event_name == 'secret_scanning_alert'
run: echo "This action was triggered by a secret scanning alert."
- name: Run on Vulnerability Alert
if: github.event_name == 'repository_vulnerability_alert'
run: echo "This action was triggered by a vulnerability alert."
- name: Run on Milestone
if: github.event_name == 'milestone'
run: echo "This action was triggered by a milestone event."
- name: Run on Label Event
if: github.event_name == 'label'
run: echo "This action was triggered by a label being created or deleted."
- name: Run on Team or Member Event
if: github.event_name == 'team' || github.event_name == 'member'
run: echo "This action was triggered by a team or member event."
- name: Run on Registry Package Event
if: github.event_name == 'registry_package'
run: echo "This action was triggered by a registry package being published or updated."
Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x