Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 36 additions & 43 deletions .github/workflows/nightly-release-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,56 +90,49 @@ jobs:
run: |
echo "🔍 Quick check for changes to determine if we should continue..."

# First check if we have unreleased changelog content
if [ "${{ steps.changelog_check.outputs.has_unreleased_content }}" == "true" ]; then
echo "✅ Found unreleased changelog content, proceeding with release"
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
echo "reason=Found unreleased changelog content" >> $GITHUB_OUTPUT
exit 0
fi

# If no unreleased changelog content, check for git changes as fallback
echo "No unreleased changelog content found, checking for git changes..."

# Check if current commit has a release tag
if git describe --tags --exact-match HEAD 2>/dev/null; then
CURRENT_TAG=$(git describe --tags --exact-match HEAD)
echo "Current commit has release tag: $CURRENT_TAG"

# For tagged commits, check if there are changes since the tag
COMMIT_COUNT=$(git rev-list ${CURRENT_TAG}..HEAD --count)
if [ "$COMMIT_COUNT" -eq 0 ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "should_continue=false" >> $GITHUB_OUTPUT
echo "reason=No changes since existing tag $CURRENT_TAG and no unreleased changelog content" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
fi
# Release bookkeeping can be committed after a tag is created. In
# particular, the auto-changelog workflow may add an entry to
# UNRELEASED_CHANGELOG.md after the release has already completed.
# That is not a new release input and must not create another nightly
# release on its own.
if CURRENT_TAG=$(git describe --tags --exact-match HEAD 2>/dev/null); then
LATEST_TAG="$CURRENT_TAG"
echo "Current commit has release tag: $LATEST_TAG"
Comment on lines +98 to +100

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Limit the exact-HEAD baseline to valid v3 release tags.

Line 98 accepts any tag at HEAD. If an unrelated tag points at HEAD, it becomes LATEST_TAG, the diff is empty, and the workflow skips pending v3 release inputs. Filter exact tags with the same v3 release schema used for fallback selection.

Proposed fix
-        if CURRENT_TAG=$(git describe --tags --exact-match HEAD 2>/dev/null); then
+        CURRENT_TAG=$(
+          git tag --points-at HEAD --format='%(refname:short)' |
+            grep -E '^v3\.0\.0($|-(alpha2|beta|rc)\.[0-9]+$)' |
+            sort -V |
+            tail -1
+        )
+        if [ -n "$CURRENT_TAG" ]; then
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if CURRENT_TAG=$(git describe --tags --exact-match HEAD 2>/dev/null); then
LATEST_TAG="$CURRENT_TAG"
echo "Current commit has release tag: $LATEST_TAG"
CURRENT_TAG=$(
git tag --points-at HEAD --format='%(refname:short)' |
grep -E '^v3\.0\.0($|-(alpha2|beta|rc)\.[0-9]+$)' |
sort -V |
tail -1
)
if [ -n "$CURRENT_TAG" ]; then
LATEST_TAG="$CURRENT_TAG"
echo "Current commit has release tag: $LATEST_TAG"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/nightly-release-v3.yml around lines 98 - 100, Update the
exact-HEAD tag detection in the nightly release workflow so CURRENT_TAG is
assigned only when the tag matches the existing v3 release schema used by
fallback selection. Preserve the current LATEST_TAG assignment and logging for
valid v3 tags, while allowing unrelated HEAD tags to continue into pending v3
release-input handling.

else
# No current tag, check against latest release.
# Only consider the active release series (alpha2/beta/rc): they
# outrank the legacy "alpha.*" tags in semver, and matching them
# explicitly keeps stray legacy tags (e.g. v3.0.0-alpha.98-tui) from
# being picked up as the latest release by a blanket glob.
# outrank legacy alpha tags, and explicit patterns avoid stray tags
# such as v3.0.0-alpha.98-tui being selected as the baseline.
LATEST_TAG=$(git tag --list "v3.0.0-alpha2.*" "v3.0.0-beta.*" "v3.0.0-rc.*" | sort -V | tail -1)
if [ -z "$LATEST_TAG" ]; then
echo "No previous release found, proceeding with release"
fi

if [ -z "$LATEST_TAG" ]; then
echo "No previous release found; a release is eligible if changelog content exists."
if [ "${{ steps.changelog_check.outputs.has_unreleased_content }}" == "true" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
echo "reason=Unreleased changelog content with no previous release" >> $GITHUB_OUTPUT
else
COMMIT_COUNT=$(git rev-list ${LATEST_TAG}..HEAD --count)
if [ "$COMMIT_COUNT" -gt 0 ]; then
echo "Found $COMMIT_COUNT commits since $LATEST_TAG"
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "should_continue=false" >> $GITHUB_OUTPUT
echo "reason=No changes since latest release $LATEST_TAG and no unreleased changelog content" >> $GITHUB_OUTPUT
fi
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "should_continue=false" >> $GITHUB_OUTPUT
echo "reason=No previous release and no unreleased changelog content" >> $GITHUB_OUTPUT
fi
elif git diff --quiet "${LATEST_TAG}..HEAD" -- \
. \
':(exclude)v3/internal/version/version.txt' \
':(exclude)v3/UNRELEASED_CHANGELOG.md' \
':(exclude)docs/src/content/docs/changelog.mdx' \
':(exclude)v3/internal/runtime/desktop/@wailsio/runtime/package.json' \
':(exclude)v3/internal/runtime/desktop/@wailsio/runtime/package-lock.json'; then
echo "No release inputs changed since $LATEST_TAG; skipping release."
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "should_continue=false" >> $GITHUB_OUTPUT
echo "reason=Only release bookkeeping changed since $LATEST_TAG" >> $GITHUB_OUTPUT
else
CHANGE_COUNT=$(git rev-list "${LATEST_TAG}..HEAD" --count)
echo "Found release inputs in $CHANGE_COUNT commits since $LATEST_TAG"
echo "has_changes=true" >> $GITHUB_OUTPUT
Comment on lines +131 to +133
echo "should_continue=true" >> $GITHUB_OUTPUT
echo "reason=Release inputs changed since $LATEST_TAG" >> $GITHUB_OUTPUT
fi

- name: Early exit - No changes detected
Expand Down
Loading