From ed25ace8045c1441ec5ab5fb1b6c920fe23ac23b Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 20 May 2025 13:05:24 +0200 Subject: [PATCH 1/2] Expand shell variables earlier Expand shell variables earlier by switching to using environment variables and referencing them in the bash commands from that rather than directly interpolating the variables. Closes #100 --- action.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index aa7a04a..f2b0fbd 100644 --- a/action.yml +++ b/action.yml @@ -45,6 +45,12 @@ runs: - name: 'Download Java Development Kit' id: download shell: bash + env: + WEBSITE: "${{ inputs.website }}" + RELEASE: "${{ inputs.release }}" + VERSION: "${{ inputs.version }}" + INSTALL_AS_VERSION: "${{ inputs.install-as-version }}" + URI: "${{ inputs.uri }}" run: | echo "::group::Prepare download..." JAVA=$JAVA_HOME_21_X64/bin/java @@ -54,18 +60,18 @@ runs: $JAVA --version DOWNLOAD=$GITHUB_ACTION_PATH/src/Download.java echo "::endgroup::" - if [ ! -z "${{ inputs.uri }}" ]; then + if [ ! -z "$URI" ]; then $JAVA \ - -Dinstall-as-version="${{ inputs.install-as-version }}" \ + -Dinstall-as-version="$INSTALL_AS_VERSION" \ $DOWNLOAD \ - ${{ inputs.uri }} + $URI else $JAVA \ - -Dinstall-as-version="${{ inputs.install-as-version }}" \ + -Dinstall-as-version="$INSTALL_AS_VERSION" \ $DOWNLOAD \ - ${{ inputs.website }} \ - ${{ inputs.release }} \ - ${{ inputs.version }} + $WEBSITE \ + $RELEASE \ + $VERSION fi - name: 'Install Java Development Kit' if: ${{ inputs.install == 'true' }} From 50530e9f72da0ad11b1753c6bfa9bc94c11069f7 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 20 May 2025 13:09:09 +0200 Subject: [PATCH 2/2] Remove outdated version from test --- test/Test.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Test.java b/test/Test.java index d67596e..dfb5d5a 100644 --- a/test/Test.java +++ b/test/Test.java @@ -30,7 +30,6 @@ static void checkAllOracleJDKs() { System.out.println(); System.out.println("// oracle.com - latest"); checkOracleJDK("24", "latest"); - checkOracleJDK("23", "latest"); checkOracleJDK("21", "latest"); System.out.println();