Maven / GitHub Actions Interview Questions
What is the difference between push, pull_request, and workflow_dispatch triggers?
These three triggers cover the most common CI/CD use-cases but serve very different purposes. Here is a direct comparison:
| Trigger | When it fires | Typical use-case | Key options |
|---|---|---|---|
push |
A commit is pushed to a branch or a tag is created | Deploy to staging/production after merging to main; publish a release on tag push | branches:, tags:, paths: |
pull_request |
A PR is opened, its head branch is updated (synchronised), or specific PR activity occurs (labeled, closed, etc.) | Run tests and linting on every proposed change before it merges; gate merges with required status checks | branches: (base branch filter), types: (activity type), paths: |
workflow_dispatch |
An operator manually triggers the workflow from the GitHub UI, the REST API, or gh workflow run |
Ad-hoc releases, environment-specific deployments, data migration scripts that should not run automatically | inputs: — define typed parameters (string, boolean, choice, environment) that the operator fills in before running |
A common pattern is to combine all three: use pull_request for pre-merge tests, push on main for deployment, and workflow_dispatch for manual rollback or hotfix releases. Each trigger runs independently so you can fine-tune which steps run for each event using if: github.event_name == 'push' inside steps.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
