fix(ci): update trigger.dev ci to only push to staging on merge to staging & for prod as well#1518
Merged
waleedlatif1 merged 1 commit intostagingfrom Oct 1, 2025
Merged
Conversation
…aging & for prod as well
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
This PR fixes an issue in the Trigger.dev deployment workflow where deployments could be triggered during pull request events instead of only on actual merges to target branches. The change adds `github.event_name == 'push'` conditions to both staging and production deployment steps in the `trigger-deploy.yml` workflow file.The modification ensures that Trigger.dev deployments only occur when code is actually pushed/merged to the staging or main branches, not when pull requests are opened against these branches. This aligns the individual deployment step conditions with the existing job-level conditions already present in the main CI workflow (ci.yml), creating a more defensive and consistent deployment strategy.
The change integrates well with the existing CI architecture, which already has similar protections at the job level. By adding these conditions at the step level, it provides an additional layer of safety to prevent accidental deployments during the PR review process.
Changed Files
| Filename | Score | Overview |
|---|---|---|
| .github/workflows/trigger-deploy.yml | 5/5 | Added event type checks to deployment conditions to prevent deployments on PR events |
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it adds defensive conditions to prevent unintended deployments
- Score reflects the simple, well-targeted nature of the fix that addresses a clear gap in deployment logic
- No files require special attention as the change is straightforward and follows existing patterns
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant GH as GitHub
participant CI as CI Workflow
participant TD as Trigger.dev
Dev->>GH: "Push to staging branch"
GH->>CI: "Trigger workflow_call"
CI->>CI: "Check: github.event_name == 'push'"
CI->>CI: "Check: github.ref == 'refs/heads/staging'"
CI->>CI: "Setup Node & Bun environment"
CI->>CI: "Install dependencies (bun install)"
CI->>TD: "Deploy to staging environment"
TD-->>CI: "Staging deployment complete"
Note over Dev,TD: Alternative flow for main branch
Dev->>GH: "Push to main branch"
GH->>CI: "Trigger workflow_call"
CI->>CI: "Check: github.event_name == 'push'"
CI->>CI: "Check: github.ref == 'refs/heads/main'"
CI->>CI: "Setup Node & Bun environment"
CI->>CI: "Install dependencies (bun install)"
CI->>TD: "Deploy to production environment"
TD-->>CI: "Production deployment complete"
1 file reviewed, no comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update trigger.dev ci to only push to staging on merge to staging & for prod as well
Type of Change
Testing
Added provision to make deployment to trigger only happen on merges to the branches, not when PRs were made against branches
Checklist