-
Notifications
You must be signed in to change notification settings - Fork 177
Fix nightly builds to use chronological tag sorting instead of version sorting #1101
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
…able releases Co-authored-by: Romanitho <[email protected]>
|
@copilot I am giving you the log of the latest nightly action run (latest task should have been v2.9.1 instead of v2.9.1-0 and i think the problem is here.): shell: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.EXE -command ". '{0}'"
|
You're absolutely right - the workflow selected The log you shared shows the OLD code running (notice the message "[INFO] Latest release tag" instead of "[INFO] Latest stable release tag"). This is because the nightly workflow runs on the Once this PR is merged, the workflow will:
Commit: 98fc06b |
❌MegaLinter analysis: Error
Detailed Issues❌ REPOSITORY / gitleaks - 2 errorsLinter output file not found
|
|
@copilot What I want: to be able to create nightly builds only if a new PR was merged on develop branch since the latest release (stable or pre-release). But I don't want nightly builds to run every night if there are no code changes. If the latest build is v2.9.0, I want v2.9.1-0, and if the latest is v2.9.1-1, I want v2.9.1-2. If there is no PR in between, the build should be skipped. |
…builds Co-authored-by: Romanitho <[email protected]>
Updated the fix to use chronological tag sorting ( Now it works correctly:
In your scenario, with v2.9.1-0 (Dec 15) and v2.9.1 (later), it will now correctly select v2.9.1 as the latest. Commit: 4a9a8b2 |
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 fixes a bug in the nightly build workflow where incorrect tag sorting caused unnecessary builds. The workflow was using --sort=-version:refname which incorrectly treated prerelease tags (e.g., v2.10.0-0) as greater than stable releases (e.g., v2.10.0), leading to comparisons against the wrong baseline tag.
Key Changes:
- Changed tag sorting from version-based (
--sort=-version:refname) to chronological (--sort=-creatordate) - Added clarifying comments explaining why chronological sorting is used
- Updated log message to reflect the change in sorting approach
…-process Fix nightly builds to use chronological tag sorting instead of version sorting

Nightly builds were being created unnecessarily by comparing against the wrong tag. Git's version sort treats
v2.10.0-0(prerelease) as greater thanv2.10.0(stable), causing the workflow to select tags based on version numbers rather than creation date.Changes
Modified
.github/workflows/GitFlow_Nightly-builds.ymlto use chronological tag sorting instead of version-based sorting:Behavior
The workflow now correctly compares against the chronologically latest release, whether stable or prerelease:
This ensures that when a stable release (v2.9.1) is created after a prerelease (v2.9.1-0), the workflow correctly uses the stable release as the comparison point.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.