pingtimeout commented on code in PR #2383:
URL: https://github.com/apache/polaris/pull/2383#discussion_r2502380025


##########
.github/workflows/release-2-update-release-candidate.yml:
##########
@@ -0,0 +1,200 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Release - 2 - Update version and Changelog for Release Candidate
+
+on:
+  workflow_dispatch:
+    inputs:
+      dry_run:
+        description: 'Dry run mode (check to enable, uncheck to perform actual 
operations)'
+        required: false
+        type: boolean
+        default: true
+
+jobs:
+  update-release-candidate:
+    name: Release - 2 - Update version and Changelog for Release Candidate
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
+        with:
+          # Fetch full history. Branch operations require this.
+          fetch-depth: 0
+          # Use a token with write permissions
+          token: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Configure Git
+        run: |
+          git config --global user.name "github-actions[bot]"
+          git config --global user.email 
"github-actions[bot]@users.noreply.github.com"
+
+      - name: Set up environment variables
+        run: |
+          echo "RELEASEY_DIR=$(pwd)/releasey" >> $GITHUB_ENV
+          echo "LIBS_DIR=$(pwd)/releasey/libs" >> $GITHUB_ENV
+
+          echo "## Mode" >> $GITHUB_STEP_SUMMARY
+          if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then
+            echo "DRY_RUN=1" >> $GITHUB_ENV
+            echo "‼️ DRY_RUN mode enabled - No actual changes will be made" >> 
$GITHUB_STEP_SUMMARY
+          else
+            echo "DRY_RUN=0" >> $GITHUB_ENV
+            echo "DRY_RUN mode disabled - Performing actual operations" >> 
$GITHUB_STEP_SUMMARY
+          fi
+
+      - name: Auto-determine release branch and next RC number
+        run: |
+          source "${LIBS_DIR}/_version.sh"
+
+          # Get the current branch name
+          current_branch=$(git branch --show-current)
+
+          echo "## Parameters" >> $GITHUB_STEP_SUMMARY
+
+          # Validate that we're on a release branch
+          if [[ ! "${current_branch}" =~ ^release/(.+)$ ]]; then
+            echo "❌ Invalid branch: \`${current_branch}\`. This workflow must 
be run from a release branch (release/major.minor.x)" >> $GITHUB_STEP_SUMMARY
+            exit 1
+          fi
+
+          # Extract version from release branch name
+          branch_version="${BASH_REMATCH[1]}"
+
+          # Validate branch version format and extract components
+          if ! validate_and_extract_branch_version "${branch_version}"; then
+            echo "❌ Invalid release branch version format: 
\`${branch_version}\`, expected: major.minor.x" >> $GITHUB_STEP_SUMMARY
+            exit 1
+          fi
+
+          # Find the next available patch number for this major.minor version
+          find_next_patch_number "${major}" "${minor}"
+

Review Comment:
   I believe it is already done.  I removed all intermediate `echo` in favor of 
the final `cat <<EOT >> $GITHUB_STEP_SUMMARY` so that we do not need to unfold 
each step to look at console output. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to