diff --git a/integrationTests/e2e/e2e.test.js b/integrationTests/e2e/e2e.test.js index 5edf50d..bb9e205 100644 --- a/integrationTests/e2e/e2e.test.js +++ b/integrationTests/e2e/e2e.test.js @@ -17,16 +17,4 @@ describe('e2e', () => { result = result.substring(1, result.length - 1); expect(process.env.JSONDATA).toBe(result); }); - - it('verify jsonstring', () => { - expect(process.env.JSONSTRING).toBe('{"x":1,"y":"qux"}'); - }); - it('verify jsonstringmultiline', () => { - expect(process.env.JSONSTRINGMULTILINE).toBe('{"x": 1, "y": "q\\nux"}'); - }); - it('verify jsondata', () => { - let result = JSON.stringify('{"x":1,"y":"qux"}'); - result = result.substring(1, result.length - 1); - expect(process.env.JSONDATA).toBe(result); - }); }); diff --git a/scripts/parse.js b/scripts/parse.js deleted file mode 100644 index bcd9aa0..0000000 --- a/scripts/parse.js +++ /dev/null @@ -1,43 +0,0 @@ -// This script is used by the e2e tests in build.yml to test that we can -// successfully parse JSON string data into JS objects - -try { - let inputs = [ - process.env.JSONSTRING, - process.env.JSONSTRINGMULTILINE, - ]; - - let names = [ - "test-json-string", - "test-json-string-multiline", - ]; - - let i = 0; - inputs.forEach(input => { - console.log(`processing: ${names[i]}`) - i++; - input = (input || '').trim(); - if (!input) { - throw new Error(`missing input`); - } - - // If the string doesn't start with a JSON object character, it is probably - // base64-encoded. - if (!input.startsWith('{')) { - let str = input.replace(/-/g, '+').replace(/_/g, '/'); - while (str.length % 4) str += '='; - input = Buffer.from(str, 'base64').toString('utf8'); - } - - try { - const creds = JSON.parse(input); - console.log('success!') - return creds; - } catch (err) { - throw new Error(`error parsing: ${err}`); - } - }) -} catch (error) { - throw new Error(`error in parse.js: ${err}`); -} - diff --git a/src/action.js b/src/action.js index 21ad578..e193650 100644 --- a/src/action.js +++ b/src/action.js @@ -107,7 +107,7 @@ async function exportSecrets() { for (const line of value.replace(/\r/g, '').split('\n')) { if (line.length > 0) { - core.setOutput(line); + core.setSecret(line); } } if (exportEnv) {