Skip to content

Commit 7323251

Browse files
Copilotswissspidy
andcommitted
Don't update branch alias for minor or patch releases
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 5c59353 commit 7323251

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/reusable-check-branch-alias.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,23 @@ jobs:
6464
VERSION="${VERSION%%+*}"
6565
6666
# Parse major, minor, and patch versions
67-
IFS='.' read -r MAJOR MINOR _ <<< "$VERSION"
67+
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
6868
69-
# Validate that MAJOR and MINOR are numeric
70-
if ! [[ "$MAJOR" =~ ^[0-9]+$ ]] || ! [[ "$MINOR" =~ ^[0-9]+$ ]]; then
69+
# Validate that MAJOR, MINOR, and PATCH are numeric
70+
if ! [[ "$MAJOR" =~ ^[0-9]+$ ]] || ! [[ "$MINOR" =~ ^[0-9]+$ ]] || ! [[ "$PATCH" =~ ^[0-9]+$ ]]; then
7171
echo "Invalid version format: $VERSION"
7272
echo "needs_update=false" >> "$GITHUB_OUTPUT"
7373
exit 0
7474
fi
7575
76-
# Calculate next minor version
77-
NEXT_MINOR=$((MINOR + 1))
78-
EXPECTED_ALIAS="${MAJOR}.${NEXT_MINOR}.x-dev"
76+
# Only update branch alias for major releases (minor and patch releases should keep the existing alias)
77+
if [ "$MINOR" != "0" ] || [ "$PATCH" != "0" ]; then
78+
echo "Not a major release (v${MAJOR}.0.0), skipping branch-alias update"
79+
echo "needs_update=false" >> "$GITHUB_OUTPUT"
80+
exit 0
81+
fi
82+
83+
EXPECTED_ALIAS="${MAJOR}.x-dev"
7984
8085
echo "Expected branch-alias: $EXPECTED_ALIAS"
8186
@@ -137,7 +142,7 @@ jobs:
137142
- Previous branch-alias: `${{ steps.check_alias.outputs.current_alias }}`
138143
- Updated branch-alias: `${{ steps.check_alias.outputs.expected_alias }}`
139144
140-
The branch-alias should point to the next minor development version after the latest release.
145+
The branch-alias should point to the major development version for the latest major release.
141146
branch: update-branch-alias
142147
delete-branch: true
143148
labels: |

0 commit comments

Comments
 (0)