Skip to content

Conversation

@Romanitho
Copy link
Owner

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.

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.
Copilot AI review requested due to automatic review settings December 16, 2025 12:12
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Dec 16, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

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
Copy link

Copilot AI Dec 16, 2025

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

MegaLinter analysis: Error

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 1.65s
⚠️ REPOSITORY checkov yes 3 no 11.66s
⚠️ REPOSITORY devskim yes 1 8 1.42s
✅ REPOSITORY dustilock yes no no 0.01s
❌ REPOSITORY gitleaks yes 2 no 0.75s
✅ REPOSITORY git_diff yes no no 0.01s
✅ REPOSITORY grype yes no no 27.17s
✅ REPOSITORY kics yes no no 1.38s
✅ REPOSITORY secretlint yes no no 0.53s
✅ REPOSITORY syft yes no no 1.25s
✅ REPOSITORY trivy yes no no 4.63s
✅ REPOSITORY trivy-sbom yes no no 0.1s
✅ REPOSITORY trufflehog yes no no 2.24s

Detailed Issues

❌ REPOSITORY / gitleaks - 2 errors

Linter output file not found

⚠️ REPOSITORY / checkov - 3 errors

Linter output file not found

⚠️ REPOSITORY / devskim - 1 error

Linter output file not found

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link
Contributor

Copilot AI commented Dec 16, 2025

@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.

@Romanitho Romanitho merged commit 2124332 into develop Dec 16, 2025
1 of 2 checks passed
@Romanitho Romanitho deleted the fix/nightlies branch December 16, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants