Run initialize-cloud only with 'test deployment' label#5933
Conversation
- Added conditional check to initialize-cloud job to run only when PR has "test deployment" label - This prevents unnecessary cloud instance initialization for PRs that don't need deployment testing - Dependent jobs (deploy-dashboard, run-tests) already have their own conditions and will be skipped accordingly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
b03bde7 to
443d46b
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the PR automation workflow by conditionally running cloud initialization only when needed, and removes obsolete TypeScript directives.
- Added conditional execution to
initialize-cloudjob based on "test deployment" label - Removed unused
@ts-expect-errordirective from RichTextEditor constants - Reduces unnecessary cloud resource usage for PRs that don't require deployment testing
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Changed pull_request trigger to only run on 'labeled' events - Removed 'opened', 'reopened', and 'synchronize' from trigger types - Kept workflow_dispatch for manual triggering - Combined with the initialize-cloud condition, workflow now only runs when: 1. A label is added to PR AND it's the "test deployment" label, OR 2. Workflow is manually triggered via workflow_dispatch This further reduces unnecessary workflow runs and cloud resource usage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added optional API_URL input parameter to workflow_dispatch - When provided, API_URL input overrides the cloud-generated API_URL - Updated initialize-cloud outputs to use: inputs.API_URL || steps.cloud_variables.outputs.API_URL - Updated prepare-instance action call to use the same conditional logic - All downstream jobs (deploy-dashboard, run-tests) automatically use the overridden API_URL via needs.initialize-cloud.outputs.API_URL This allows developers to manually trigger the workflow against a custom Saleor backend instance for testing purposes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Updated initialize-cloud job condition to handle workflow_dispatch events - Added check: github.event_name == 'workflow_dispatch' || contains(labels, 'test deployment') - Prevents null reference error when workflow is manually triggered (PR context is null) Co-authored-by: Copilot <noreply@github.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5933 +/- ##
=======================================
Coverage 40.06% 40.06%
=======================================
Files 2473 2473
Lines 40170 40170
Branches 9151 9151
=======================================
Hits 16093 16093
Misses 22867 22867
Partials 1210 1210 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
initialize-cloudjob to run only when PR has "test deployment" labelworkflow_dispatchtrigger for manual executionChanges
.github/workflows/pr-automation.yml:Trigger optimization: Changed from multiple PR events to only
labeledeventJob condition: Added check to
initialize-cloudjobBenefits
deploy-dashboard,run-tests) are automatically skipped when conditions aren't metBehavior
When workflow runs:
initialize-cloudruns → deployment happensinitialize-cloudis skipped → no deploymentinitialize-cloudruns → deployment happensWhen workflow does NOT run:
Test plan
initialize-cloudis skippedinitialize-cloudprovisions environment🤖 Generated with Claude Code