-
Notifications
You must be signed in to change notification settings - Fork 177
Improve nightly build PR check and logging #1095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Enhanced the PowerShell script in the nightly build workflow to provide clearer logging, more robust detection of merged PRs since the last release, and improved logic for determining when a build is needed. The script now distinguishes between manual and scheduled triggers, checks for changes more reliably, and outputs detailed information about the release type and build decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the nightly build workflow's PowerShell script to provide more robust detection of merged PRs since the last release, clearer logging throughout the build decision process, and improved handling of manual versus scheduled triggers.
Key changes:
- Added comprehensive logging with color-coded output for better visibility into the build decision process
- Separated manual trigger logic (always builds) from scheduled trigger logic (checks for changes first)
- Improved PR detection by comparing commit SHAs and checking for merged PRs between tag commit and HEAD
| Write-Host "========================================" -ForegroundColor Cyan | ||
| echo "BUILD_NEEDED=$BUILD_NEEDED" >> $env:GITHUB_OUTPUT | ||
| echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RELEASE_TYPE variable may not be defined in all code paths. Specifically, when the manual trigger is invoked (workflow_dispatch), the code only sets BUILD_NEEDED to true but doesn't execute the else block where RELEASE_TYPE would be set in automated scenarios. However, RELEASE_TYPE is determined earlier (lines 51-60), so this should work. But if LATEST_TAG is empty or null, RELEASE_TYPE would never be initialized, causing this line to output an empty value. Add a default initialization for RELEASE_TYPE at the beginning of the script to handle edge cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
| Write-Host "Release type: $RELEASE_TYPE" -ForegroundColor Cyan | ||
| Write-Host "========================================" -ForegroundColor Cyan | ||
| echo "BUILD_NEEDED=$BUILD_NEEDED" >> $env:GITHUB_OUTPUT |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BUILD_NEEDED variable may not be defined in all code paths. If the script reaches line 127 without entering either the manual trigger branch (line 63) or the else branch (line 68), BUILD_NEEDED would be undefined when written to GITHUB_OUTPUT. Initialize BUILD_NEEDED with a default value (e.g., $false) at the beginning of the script to ensure it always has a value.
❌MegaLinter analysis: Error
Detailed Issues❌ REPOSITORY / gitleaks - 2 errorsLinter output file not found
|
Co-authored-by: Copilot <[email protected]>
|
@Romanitho I've opened a new pull request, #1097, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Romanitho <[email protected]>
Add default initialization for RELEASE_TYPE to handle edge cases
Co-authored-by: Copilot <[email protected]>
…utoUpdate into fix/nightlies

Enhanced the PowerShell script in the nightly build workflow to provide clearer logging, more robust detection of merged PRs since the last release, and improved logic for determining when a build is needed. The script now distinguishes between manual and scheduled triggers, checks for changes more reliably, and outputs detailed information about the release type and build decision.