Copilot commented on code in PR #15370:
URL: https://github.com/apache/grails-core/pull/15370#discussion_r2750440026

##########
.github/workflows/publish-docs.yml:
##########
@@ -16,21 +16,26 @@
 name: "Publish Documentation"
 on:
   workflow_dispatch:
+    inputs:
+      version:
+        description: 'Release version (e.g., 7.0.0)'
+        required: true
+        type: string
 permissions: { }
 env:
   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   JAVA_DISTRIBUTION: liberica
   JAVA_VERSION: 17.0.18
-  REF: ${{ github.ref_name }}
-  VERSION: will be computed
+  TARGET_BRANCH: ${{ github.ref_name }}
+  VERSION: ${{ inputs.version }}
 jobs:
   docs:
     environment: docs
     name: "Publish Documentation"
     runs-on: ubuntu-24.04
     steps:
-      - name: "📝 Establish release version"
-        run: echo "VERSION=${REF#v}" >> "$GITHUB_ENV"
+      - name: "📝 Store release version"
+        run: echo "VERSION=${VERSION}" >> "$GITHUB_ENV"

Review Comment:
   This step is redundant because it only echoes the VERSION variable back to 
GITHUB_ENV without modification, and the VERSION variable is not used anywhere 
in subsequent steps. Since VERSION is already set in the workflow-level env 
section (line 30) and never referenced, this step serves no purpose and should 
be removed.
   ```suggestion
   
   ```



##########
.github/workflows/publish-docs.yml:
##########
@@ -16,21 +16,26 @@
 name: "Publish Documentation"
 on:
   workflow_dispatch:
+    inputs:
+      version:
+        description: 'Release version (e.g., 7.0.0)'
+        required: true
+        type: string
 permissions: { }
 env:
   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   JAVA_DISTRIBUTION: liberica
   JAVA_VERSION: 17.0.18
-  REF: ${{ github.ref_name }}
-  VERSION: will be computed
+  TARGET_BRANCH: ${{ github.ref_name }}
+  VERSION: ${{ inputs.version }}

Review Comment:
   The VERSION environment variable is defined but never used in this workflow. 
Neither the gradle build command (line 68) nor the deploy-github-pages action 
(lines 69-77) reference this variable. The Gradle build uses projectVersion 
from gradle.properties instead. Consider removing this unused environment 
variable to avoid confusion.



##########
.github/workflows/publish-docs.yml:
##########
@@ -16,21 +16,26 @@
 name: "Publish Documentation"
 on:
   workflow_dispatch:
+    inputs:
+      version:
+        description: 'Release version (e.g., 7.0.0)'
+        required: true
+        type: string

Review Comment:
   The version input lacks validation for the expected format. The description 
indicates it should be in the format like '7.0.0', but there's no validation to 
ensure this. Consider adding a pattern constraint (e.g., using a regex pattern 
like '^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9\-\.]+)?$') to validate the input 
format and prevent invalid version strings.



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