From b9eb19a139f9f54036541d1bc9a8e0c4c115ae8c Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Sat, 14 Dec 2019 15:29:07 -0800 Subject: [PATCH 1/2] Base64 is one more than Base63 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76cf4a3..d56687b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Base63 to File +# Base64 to File Use this action if you need to get a file from a base64-encoded string that you may be storing in Secrets or elsewhere. This can be useful for certificate signing and storing the base64 cert in the Secrets. From d0d6d6f6a1e3c7a40e7c998a6a903b1d8e319e05 Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Sat, 14 Dec 2019 16:04:17 -0800 Subject: [PATCH 2/2] fixing Readme and adding temp --- README.md | 19 ++++++++++++++++++- dist/index.js | 2 +- index.js | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d56687b..e7b4491 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,25 @@ Use this action if you need to get a file from a base64-encoded string that you ``` - name: Run Workflow id: write_file - uses: ./ + uses: timheuer/base64-to-file@v1 with: fileName: 'myTemporaryFile.txt' encodedString: ${{ secrets.SOME_ENCODED_STRING }} +``` + +## Using the file in a later step +The Action has an output variable named filePath that you can use as this file is written to TEMP. Make sure you ad an `id` to your step when using this Action so that you can easily pull it out of the steps context later. + +``` +- name: Run Workflow + id: write_file + uses: timheuer/base64-to-file@v1 + with: + fileName: 'myTemporaryFile.txt' + encodedString: ${{ secrets.SOME_ENCODED_STRING }} + +- name: Some other step + uses: actions/someaction@master + with: + filelocation: ${{ steps.write_file.outputs.filePath }} ``` \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index a75127f..585ab4e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -57,7 +57,7 @@ const core = __webpack_require__(470); const fs = __webpack_require__(747); // get input parameter values from config -var fileName = core.getInput('fileName'); +var fileName = process.env['TEMP'] + '\\' + core.getInput('fileName'); var encodedString = core.getInput('encodedString'); // most @actions toolkit packages have async methods diff --git a/index.js b/index.js index e838758..1ea2148 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const core = require('@actions/core'); const fs = require('fs'); // get input parameter values from config -var fileName = core.getInput('fileName'); +var fileName = process.env['TEMP'] + '\\' + core.getInput('fileName'); var encodedString = core.getInput('encodedString'); // most @actions toolkit packages have async methods