From 505c9972aaacb74f4825887c1b6d2328758fcf46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2020 18:00:13 +0000 Subject: [PATCH 1/6] Bump @actions/http-client from 1.0.6 to 1.0.8 Bumps [@actions/http-client](https://github.com/actions/http-client) from 1.0.6 to 1.0.8. - [Release notes](https://github.com/actions/http-client/releases) - [Changelog](https://github.com/actions/http-client/blob/master/RELEASES.md) - [Commits](https://github.com/actions/http-client/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66e0b6d4..12271ed0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,9 +18,9 @@ } }, "@actions/http-client": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.6.tgz", - "integrity": "sha512-LGmio4w98UyGX33b/W6V6Nx/sQHRXZ859YlMkn36wPsXPB82u8xTVlA/Dq2DXrm6lEq9RVmisRJa1c+HETAIJA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz", + "integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==", "requires": { "tunnel": "0.0.6" } diff --git a/package.json b/package.json index 57a69f5e..bc97adc1 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "dependencies": { "@actions/core": "^1.0.0", "@actions/exec": "^1.0.0", - "@actions/http-client": "^1.0.6", + "@actions/http-client": "^1.0.8", "@actions/io": "^1.0.0", "@actions/tool-cache": "^1.3.1", "semver": "^6.1.1" From 4003c04fbcd7c6d5d67fa11e57d706021663f6b2 Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Mon, 11 May 2020 20:09:41 +0200 Subject: [PATCH 2/6] Delete lint-yaml.yml --- .github/workflows/lint-yaml.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .github/workflows/lint-yaml.yml diff --git a/.github/workflows/lint-yaml.yml b/.github/workflows/lint-yaml.yml deleted file mode 100644 index 4511eed8..00000000 --- a/.github/workflows/lint-yaml.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Lint YAML -on: [pull_request] -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Lint action.yml - uses: ibiqlik/action-yamllint@master - with: - file_or_dir: action.yml - config_file: yaml-lint-config.yml From 457d7a45797988287acdd155500b99aa2014b79d Mon Sep 17 00:00:00 2001 From: Thomas Broyer Date: Sun, 24 May 2020 20:03:57 +0200 Subject: [PATCH 3/6] Add output parameters for the tool path and version This allows calling the action multiple times in the same job and retrieving the path and/or version in other steps. Fixes #65 --- .github/workflows/workflow.yml | 11 +++++++---- __tests__/verify-java.ps1 | 20 ++++++++++++++++++++ __tests__/verify-java.sh | 24 ++++++++++++++++++++++-- action.yml | 5 +++++ dist/index.js | Bin 168248 -> 169053 bytes src/installer.ts | 2 ++ 6 files changed, 56 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index dda73067..1b7aa658 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -35,15 +35,16 @@ jobs: if: runner.os == 'windows' run: move "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old" - name: Setup Java 13 + id: setup-java uses: ./ with: java-version: 13.0.2 - name: Verify Java 13 if: runner.os != 'windows' - run: __tests__/verify-java.sh 13.0.2 + run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}" - name: Verify Java 13 (Windows) if: runner.os == 'windows' - run: __tests__/verify-java.ps1 13.0.2 + run: __tests__/verify-java.ps1 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}" test-proxy: runs-on: ubuntu-latest @@ -62,11 +63,12 @@ jobs: - name: Clear tool cache run: rm -rf $RUNNER_TOOL_CACHE/* - name: Setup Java 13 + id: setup-java uses: ./ with: java-version: 13.0.2 - name: Verify Java 13 - run: __tests__/verify-java.sh 13.0.2 + run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}" test-bypass-proxy: runs-on: ubuntu-latest @@ -78,8 +80,9 @@ jobs: - name: Clear tool cache run: rm -rf $RUNNER_TOOL_CACHE/* - name: Setup Java 13 + id: setup-java uses: ./ with: java-version: 13.0.2 - name: Verify Java 13 - run: __tests__/verify-java.sh 13.0.2 + run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}" diff --git a/__tests__/verify-java.ps1 b/__tests__/verify-java.ps1 index 9f675c89..359f2915 100644 --- a/__tests__/verify-java.ps1 +++ b/__tests__/verify-java.ps1 @@ -9,3 +9,23 @@ if (!$java_version.Contains($args[0])) { throw "Unexpected version" } + +if ($args.Count -lt 2 -or !$args[1]) +{ + throw "Must supply java path argument" +} + +if ($args[1] -ne $Env:JAVA_HOME) +{ + throw "Unexpected path" +} + +if ($args.Count -lt 3 -or !$args[2]) +{ + throw "Must supply java version argument" +} + +if ($args[0] -ne $args[2]) +{ + throw "Unexpected version" +} diff --git a/__tests__/verify-java.sh b/__tests__/verify-java.sh index f34aba50..e0da7d3a 100755 --- a/__tests__/verify-java.sh +++ b/__tests__/verify-java.sh @@ -1,13 +1,33 @@ #!/bin/sh if [ -z "$1" ]; then - echo "Must supply java version argument" + echo "::error::Must supply java version argument" exit 1 fi java_version="$(java -version 2>&1)" echo "Found java version: $java_version" if [ -z "$(echo $java_version | grep --fixed-strings $1)" ]; then - echo "Unexpected version" + echo "::error::Unexpected version" + exit 1 +fi + +if [ -z "$2" ]; then + echo "::error::Must supply java path argument" + exit 1 +fi + +if [ "$2" != "$JAVA_HOME" ]; then + echo "::error::Unexpected path" + exit 1 +fi + +if [ -z "$3" ]; then + echo "::error::Must supply java version argument" + exit 1 +fi + +if [ "$1" != "$3" ]; then + echo "::error::Unexpected version" exit 1 fi diff --git a/action.yml b/action.yml index de7711fa..d41f286a 100644 --- a/action.yml +++ b/action.yml @@ -36,6 +36,11 @@ inputs: settings-path: description: 'Path to where the settings.xml file will be written. Default is ~/.m2.' required: false +outputs: + path: + description: 'Path to where the java environment has been installed (same as $JAVA_HOME)' + version: + description: 'Actual version of the java environment that has been installed' runs: using: 'node12' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 9663265367c82ea787bffe9122dd3970af3e1aad..263460632253c415a88c1012a6a5d2f9af433039 100644 GIT binary patch delta 1329 zcmaJ>U1(fI6lNy7*>t;El5BRO+eUm*j7^NzqD?nVQfw_tGVVRey=3>^ z+nL!-Q~D5%N*^09?SS~CFA5?S3b$|82SGuk6tPkxwUi=_AeIIpjS**m5}JU{%boL` zbH4L4=iI9w1%LS@xNrq6-h67pwnwNnKL)3Zzy`)V1rqo8+d8GRE& zn*8`7O3KRt9Fw;mqVMIWtLS+t*HB~UK_U#3rzZ>a%oqq}0w=wszY@M&v^sKQ6|K0D zLbJ>!@vcAtIHxnZ~`hF;#S z?a1kkK31Zk>ShN7{QZ(A{ zP{u*ue1_vJpWalHX7zzs56hoeo}ux$y|jD1JI znh}QPyK8pexgQ+U4#n|?W! zM`14*!{dJW!xV0ox4Ut@)Z;j!R)${W+4- z)M#@-MUj`6R|#5=J2V{ezUac?m!wm~zSf-0Ak9H!ioz+1l;%)j$RPvA6OVxnKW3XQ`+H)iP7=N(Xq^llWGBy z*HK*Feh0VpRNVg8tL7wo-^Gu*HOu}_pO5w4NCy=p#z+E2UeRkMN;GjclbQef=W+hCeBUyE z*OHxsD@*$GC5V~2x`ask)hOe>GwKM72ADP^D@+loaWDO&1sPW}T7(sty+R*jy&}#u zFJ8|>BRl!$X2_6~hbQ!6~@EXj48*S@w zqRvB4Q4vpYUwB9!3o@Z47^kiDFkW7V4|b|Co>mpkd_#YO19hHUb!Ix%oq(btmiZDvo*3Fcdh)cSy zm^_7IH&-J`kDlL0ykrmGh#m`R-`&WaeQnpX7P4A|lU73Uft9r4ij{mUlQNuXZN_gE zA>mRvc~#<$%StrGwA{*YEk3It3(b+iq)({b>L}CvGG}g2h@PbCg^Pp9ke5b0UV3Q~ zr^-pS{-lz`!0{hkH)@kGgIAxeBeEGAn@ByOlZCi)Z`=3bhMkn^sV4HK#3gmgi4=<( zsSIZr7sshvGP2@A78(Atp^Sy(k?__G9K`GvnDpB%>W5~MB{t`4#caZwz6RQ$5Zj!vunX)(`56I tq^NsPYTOhtI>%RldwO?Kz5f~!q}0dLsf2L1cw0R9?gnw{ Date: Wed, 17 Jun 2020 17:42:32 +0200 Subject: [PATCH 4/6] Normalize extendedJavaHome environment variable The extendedJavaHome environment variable contains `.` symbols in the version. This causes the environment variable to be ignored by the action runner. It's best to replace those and other non standard symbols with and underscore. For reference: > Environment variable names used by the utilities in the Shell and Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase letters, digits, and the '_' (underscore) from the characters defined in Portable Character Set . --- dist/index.js | Bin 169053 -> 169140 bytes src/installer.ts | 1 + 2 files changed, 1 insertion(+) diff --git a/dist/index.js b/dist/index.js index 263460632253c415a88c1012a6a5d2f9af433039..36a56bb73bce8868edb84e236002e4167cd11d36 100644 GIT binary patch delta 101 zcmcb+f@{l4u7(!IEllsTd{Qe)Qu9($Q@j$(5Qj44ui&Hf; r^@>spauSnMHT0w740J6Wb)({A_0x3})Z^8sOJp<2Z)eVCiqZrCxt1dy delta 24 gcmdn8lI!jYu7(!IEllsTrdMS%iENL`W{T1T0EW~Fo&W#< diff --git a/src/installer.ts b/src/installer.ts index 487db6ff..7a8feaec 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -87,6 +87,7 @@ export async function getJava( } let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch; + extendedJavaHome = extendedJavaHome.toUpperCase().replace(/[^0-9A-Z_]/g, '_'); core.exportVariable('JAVA_HOME', toolPath); core.exportVariable(extendedJavaHome, toolPath); core.addPath(path.join(toolPath, 'bin')); From 655cb05195987cc98509c9d014293425433f2676 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Wed, 17 Jun 2020 19:37:01 +0200 Subject: [PATCH 5/6] Add comment explaining why the environment variable should be normalized --- dist/index.js | Bin 169140 -> 169451 bytes src/installer.ts | 4 ++++ 2 files changed, 4 insertions(+) diff --git a/dist/index.js b/dist/index.js index 36a56bb73bce8868edb84e236002e4167cd11d36..aed138ad17ae55d4664c10766b648384030b303f 100644 GIT binary patch delta 308 zcmYk0F;2rk5Ji=g?rErg7a@Uj3xue1f$@66ZnWO9X2%Y$Lct9<1)`0_EjR`Z1y^7V z6rN^AU-SR_=hy1%t$KQ1o!8%o%k37oqUc49nh=9cP^K&?zYs1?8QIGaTS$r%T#-XI z$iBk=6#vlotd24xvKec>MjIZ2l})LIdB%|1qB~KpvGc6FFDH&XCyuPPjGO=Y(YRRJ z(>;xJCmmxX4b()2$sZ8E#2KL6M{ Date: Wed, 17 Jun 2020 21:37:10 +0200 Subject: [PATCH 6/6] Keep old environment variable for backwards compatibility --- dist/index.js | Bin 169451 -> 169530 bytes src/installer.ts | 1 + 2 files changed, 1 insertion(+) diff --git a/dist/index.js b/dist/index.js index aed138ad17ae55d4664c10766b648384030b303f..d77e3beb31427bed5ab566eabefe2c8b0a2a2b67 100644 GIT binary patch delta 47 zcmaF8nrqh@u7(!IEllsTrf