You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new if condition uses github.event.pull_request.draft without verifying the event type. On non-pull_request triggers this context is undefined, causing the optimize job to always skip or fail. Add a guard for github.event_name == 'pull_request'.
The unconditional if: ${{ github.event.pull_request.draft == false }} applies to push and workflow_dispatch events where pull_request is undefined, leading to unexpected skips. Wrap or conditionally apply the check only on pull_request events.
The added if on github.event.pull_request.draft will skip the unit-tests job for push and workflow_dispatch events. Consider restricting this check to pull_request triggers to avoid unintended skips.
Prevent evaluation errors on push events by checking that the workflow is running on a pull request before accessing github.event.pull_request.draft. Add github.event_name == 'pull_request' to the condition.
Why: Since this workflow is triggered on both push and pull_request, adding the github.event_name == 'pull_request' guard avoids evaluation failures when pull_request.draft is undefined.
Medium
Add pull request event guard
Guard the draft check by ensuring the event is a pull request to avoid null context errors when this workflow runs on other event types. Prepend github.event_name == 'pull_request' to the condition. This prevents evaluation failures in non-PR triggers.
Why: Guarding with github.event_name == 'pull_request' prevents null context errors when this workflow runs on non-PR events, making the draft check safe.
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
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.
PR Type
Enhancement
Description
Prevent workflows running on draft pull requests
Add draft-check
ifto optimize jobAdd draft-check
ifto all e2e workflowsAdd draft-check
ifto CI and label workflowsDiagram Walkthrough
File Walkthrough
14 files
Include draft check in optimize jobAdd draft-check `if` to benchmark jobAdd draft-check `if` to pytest jobAdd draft-check `if` to unittest jobAdd draft-check `if` to coverage jobAdd draft-check `if` to structure jobAdd draft-check `if` to init jobAdd draft-check `if` to topological jobAdd draft-check `if` to tracer jobSkip labeling on draft pull requestsSkip type-check on draft pull requestsSkip PR agent on draft pull requestsSkip pre-commit hooks on draft pull requestsSkip unit tests on draft pull requests