Skip to content

Commit e494666

Browse files
committed
fixed setSecret
1 parent d94db22 commit e494666

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎dist/setup/index.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28628,8 +28628,6 @@ const DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE';
2862828628
function run() {
2862928629
return __awaiter(this, void 0, void 0, function* () {
2863028630
try {
28631-
// Set secrets before use
28632-
core.setSecret('gpg-private-key');
2863328631
let version = core.getInput('version');
2863428632
if (!version) {
2863528633
version = core.getInput('java-version', { required: true });
@@ -28647,6 +28645,9 @@ function run() {
2864728645
DEFAULT_GPG_PRIVATE_KEY;
2864828646
const gpgPassphrase = core.getInput('gpg-passphrase', { required: false }) ||
2864928647
(gpgPrivateKey ? DEFAULT_GPG_PASSPHRASE : undefined);
28648+
if (gpgPrivateKey) {
28649+
core.setSecret(gpgPrivateKey);
28650+
}
2865028651
yield auth.configAuthentication(id, username, password, gpgPassphrase);
2865128652
if (gpgPrivateKey) {
2865228653
console.log('importing private key');

‎src/setup-java.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ const DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE';
1212

1313
async function run() {
1414
try {
15-
// Set secrets before use
16-
core.setSecret('gpg-private-key');
17-
1815
let version = core.getInput('version');
1916
if (!version) {
2017
version = core.getInput('java-version', {required: true});
@@ -40,6 +37,10 @@ async function run() {
4037
core.getInput('gpg-passphrase', {required: false}) ||
4138
(gpgPrivateKey ? DEFAULT_GPG_PASSPHRASE : undefined);
4239

40+
if (gpgPrivateKey) {
41+
core.setSecret(gpgPrivateKey);
42+
}
43+
4344
await auth.configAuthentication(id, username, password, gpgPassphrase);
4445

4546
if (gpgPrivateKey) {

0 commit comments

Comments
 (0)