Skip to content

Use "22" in outputs.version for EA java versions rather than a hashcode #65

Open
@vlsi

Description

@vlsi

Currently, outputs.version is somewhat useless since it results in hashcode of the URI:

Run oracle-actions/setup-java@7a0114d66dbd02646abd345c3395b34c148e6126
  with:
    website: jdk.java.net
    release: EA
    version: latest
    install: true
  env:
    ACTIONS_STEP_DEBUG: true
    ACTIONS_RUNNER_DEBUG: true
    TZ: America/New_York
    JAVA_HOME: /home/pgjdbc/actions-runner/_work/_tool/Java_Oracle_jdk/17/aarch6[4](https://github.com/pgjdbc/pgjdbc/actions/runs/7004394931/job/19052049332#step:5:4)
    JAVA_HOME_17_AARCH[6](https://github.com/pgjdbc/pgjdbc/actions/runs/7004394931/job/19052049332#step:5:6)4: /home/pgjdbc/actions-runner/_work/_tool/Java_Oracle_jdk/1[7](https://github.com/pgjdbc/pgjdbc/actions/runs/7004394931/job/19052049332#step:5:7)/aarch64
    JAVA_HOME_17_X64: /home/pgjdbc/actions-runner/_work/_tool/Java_Oracle_jdk/17/aarch64

=>

  Java configuration:
    Distribution: jdkfile
    Version: 1604803799
    Path: /home/pgjdbc/actions-runner/_work/_tool/Java_jdkfile_jdk/1604803799/arm64

I guess the culprit is

case "HASH_URI" -> Integer.toString(Math.abs(uri.hashCode()));

Note that Math.abs(Integer.MIN_VALUE) yeilds Integer.MIN_VALUE, so you probably do not want using Math.abs for hash codes.

I suggest using a release version instead, so the users could configure release: ea and then use the actual release (e.g. 22, 23, ...) in their build system configurations.

I can't understand how could I use release: ga with the current action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions