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 is pushed to a branch. |
pull_request | Triggered 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_review | Triggered when someone submits a review to a pull request. | Notify team members or run workflows based on PR reviews. |
pull_request_review_comment | Triggered when a comment is added to a pull request review. | Automate responses or actions based on review comments on pull requests. |
workflow_dispatch | Allows manually triggering a workflow via the GitHub Actions interface. | Trigger workflows manually, often used for custom workflows like deployments or tests. |
schedule | Triggered based on a cron schedule (e.g., daily, weekly). | Run periodic tasks like nightly builds, backups, or maintenance tasks. |
release | Triggered when a release is published, edited, or deleted. | Automatically deploy, notify teams, or create release notes when a new release is created. |
issue_comment | Triggered when a comment is added to an issue or pull request. | Respond to comments, automate issue management, or trigger builds/tests based on comments. |
issues | Triggered when an issue is opened, edited, labeled, or closed. | Automate issue triaging, labeling, or closing stale issues. |
create | Triggered when a branch or tag is created. | Notify teams, or trigger CI/CD workflows when new branches/tags are created. |
delete | Triggered when a branch or tag is deleted. | Clean up resources or notify teams when a branch or tag is removed. |
fork | Triggered when a repository is forked. | Send a notification or log repository forks for tracking. |
star | Triggered when a repository is starred or unstarred. | Send a thank-you message or track the repository’s popularity. |
watch | Triggered when someone starts watching the repository. | Notify maintainers or track the repository’s watchers. |
public | Triggered when a repository is made public. | Notify teams or trigger security workflows when a repository’s visibility changes. |
workflow_run | Triggered by the completion of another workflow. | Chain workflows together, such as triggering deployments after a successful test run. |
workflow_call | Triggered when a reusable workflow is called from another workflow. | Allows reusability of workflows across repositories. |
status | Triggered 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_run | Triggered when a check run (e.g., CI test) is created, completed, or updated. | Trigger workflows based on the results of automated checks. |
check_suite | Triggered when a check suite (collection of check runs) is requested or completed. | Perform actions based on the aggregate results of check suites. |
repository_dispatch | Triggered when an external service or another workflow sends a repository_dispatch event. | Trigger workflows from external systems or via API requests. |
deployment | Triggered when a deployment is created. | Automate deployment processes like deploying applications or setting up infrastructure. |
deployment_status | Triggered 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_target | Triggered 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_rule | Triggered when a branch protection rule is added, edited, or deleted. | Monitor or enforce branch protection changes. |
discussion | Triggered when a discussion is created, edited, or deleted. | Automate discussion management, notify teams, or categorize discussions. |
discussion_comment | Triggered when a comment is added to a discussion. | Automate responses or notifications based on discussion comments. |
repository_vulnerability_alert | Triggered when GitHub detects a security vulnerability in the repository. | Automate security workflows, patch dependencies, or notify security teams. |
package | Triggered when a package is published or updated. | Automate tasks like deployment or testing when a new package is released. |
push_tag | Triggered when a tag is pushed to the repository. | Use for versioning, release automation, or CI based on tagging. |
milestone | Triggered when a milestone is created, edited, or closed. | Automate milestone tracking or notify teams of milestone progress. |
label | Triggered when a label is created, edited, or deleted. | Automate label management for issues and pull requests. |
registry_package | Triggered when a registry package is published, updated, or deleted. | Manage or monitor changes in packages stored in GitHub’s registry. |
page_build | Triggered when a GitHub Pages site build completes. | Automate tasks like notifying teams or triggering follow-up actions after a site is built. |
member | Triggered when a user is added, removed, or invited to a repository. | Automate onboarding or offboarding workflows for team members. |
team | Triggered when a team is added, modified, or deleted. | Automate team management workflows. |
workflow_call | Triggered when another workflow calls a reusable workflow. | Useful for creating reusable workflows that can be invoked by multiple workflows. |
secret_scanning_alert | Triggered when GitHub identifies sensitive data in the repository. | Automatically notify security teams or handle leaked secrets. |
Explanation of Key Events
push
: This is one of the most commonly used events, triggering workflows when commits are pushed to a specific branch.pull_request
: Triggered whenever a pull request is opened, updated, or merged. It’s useful for running CI/CD pipelines based on pull requests.workflow_dispatch
: This allows manual triggering of workflows, useful for scenarios like manually starting a deployment.schedule
: Allows workflows to run at specific times using cron syntax. Useful for nightly builds or periodic maintenance tasks.release
: Used to trigger workflows when a new release is created. This is often used for deployment workflows.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.deployment
/deployment_status
: Automate the deployment process when a new deployment is created or monitor the deployment status to handle rollback or notification.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." |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND