Skip to content

Commit

Permalink
fixed setSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Petersen committed May 23, 2020
1 parent d94db22 commit e494666
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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');
Expand Down
7 changes: 4 additions & 3 deletions src/setup-java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand All @@ -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) {
Expand Down

0 comments on commit e494666

Please sign in to comment.