gemini-code-assist[bot] commented on code in PR #38931:
URL: https://github.com/apache/beam/pull/38931#discussion_r3407975302


##########
.github/actions/setup-environment-action/action.yml:
##########
@@ -74,7 +74,7 @@ runs:
       uses: actions/setup-java@v3
       with:
         distribution: 'temurin'
-        java-version: ${{ inputs.java-version == 'default' && '11' || 
inputs.java-version }}
+        java-version: ${{ inputs.java-version == 'default' && 
((contains(github.job, 'Xlang') || contains(github.job, 'XVR') || 
contains(github.job, 'PreCommit_Java')) && '17' || '11') || inputs.java-version 
}}

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Hardcoding specific job name patterns (like 'Xlang', 'XVR', and 
'PreCommit_Java') inside a shared action reduces its modularity and 
maintainability. If new jobs require Java 17 or existing jobs are renamed, this 
action will need to be constantly updated. Instead of inspecting github.job 
inside the action, consider passing the appropriate java-version (e.g., '17') 
as an input parameter directly from the calling workflow files.



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