Skip to content

Commit

Permalink
Added password
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana-Prajea committed Mar 24, 2020
1 parent ea9fb25 commit ef0dd9e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ inputs:
recursive:
description: 'Recursively search for supported files.'
required: false
password:
description: 'The password'
required: false
runs:
using: 'node12'
main: 'dist/index.js'
24 changes: 12 additions & 12 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ async function downloadNuGet() {
async function signWithSigntool(fileName: string) {
try {
const password : string= core.getInput('password');
var unencoded_password = '';
if (password != ''){
console.log('I found a password!')
unencoded_password = Buffer.from(password, 'base64');
if (unencoded_password.length == 0) {
console.log('The value for "password" is not set.');
return false;
}
console.log(`Got password ${unencoded_password}.`);
}
// var unencoded_password = '';
// if (password != ''){
// console.log('I found a password!')
// unencoded_password = Buffer.from(password, 'base64');
// if (unencoded_password.length == 0) {
// console.log('The value for "password" is not set.');
// return false;
// }
// console.log(`Got password ${unencoded_password}.`);
// }
var command = `"${signtool}" sign /f ${certificateFileName} /tr ${timestampUrl} /td sha256 /fd sha256 ${fileName}`;
if (unencoded_password != ''){
if (password != ''){
console.log("Adding password")
command = command + ` /p ${unencoded_password}`
command = command + ` /p ${password}`
}
console.log("Final command: " + command);
const { stdout } = await asyncExec(command);
Expand Down

0 comments on commit ef0dd9e

Please sign in to comment.