From e494666ae9d2e3393de43dd97ac23ed5dfb6d435 Mon Sep 17 00:00:00 2001 From: Jared Petersen Date: Fri, 22 May 2020 21:30:38 -0700 Subject: [PATCH] fixed setSecret --- dist/setup/index.js | 5 +++-- src/setup-java.ts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index cdddbdbc..7ce4950f 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -28628,8 +28628,6 @@ const DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE'; function run() { return __awaiter(this, void 0, void 0, function* () { try { - // Set secrets before use - core.setSecret('gpg-private-key'); let version = core.getInput('version'); if (!version) { version = core.getInput('java-version', { required: true }); @@ -28647,6 +28645,9 @@ function run() { DEFAULT_GPG_PRIVATE_KEY; const gpgPassphrase = core.getInput('gpg-passphrase', { required: false }) || (gpgPrivateKey ? DEFAULT_GPG_PASSPHRASE : undefined); + if (gpgPrivateKey) { + core.setSecret(gpgPrivateKey); + } yield auth.configAuthentication(id, username, password, gpgPassphrase); if (gpgPrivateKey) { console.log('importing private key'); diff --git a/src/setup-java.ts b/src/setup-java.ts index 04e3bf11..ed1a6832 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -12,9 +12,6 @@ const DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE'; async function run() { try { - // Set secrets before use - core.setSecret('gpg-private-key'); - let version = core.getInput('version'); if (!version) { version = core.getInput('java-version', {required: true}); @@ -40,6 +37,10 @@ async function run() { core.getInput('gpg-passphrase', {required: false}) || (gpgPrivateKey ? DEFAULT_GPG_PASSPHRASE : undefined); + if (gpgPrivateKey) { + core.setSecret(gpgPrivateKey); + } + await auth.configAuthentication(id, username, password, gpgPassphrase); if (gpgPrivateKey) {