Skip to content

Commit 13902e1

Browse files
authored
Merge pull request #2 from timheuer/v1
V1
2 parents a4a5620 + d0d6d6f commit 13902e1

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Base63 to File
1+
# Base64 to File
22

33
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.
44

@@ -7,8 +7,25 @@ Use this action if you need to get a file from a base64-encoded string that you
77
```
88
- name: Run Workflow
99
id: write_file
10-
uses: ./
10+
uses: timheuer/base64-to-file@v1
1111
with:
1212
fileName: 'myTemporaryFile.txt'
1313
encodedString: ${{ secrets.SOME_ENCODED_STRING }}
14+
```
15+
16+
## Using the file in a later step
17+
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.
18+
19+
```
20+
- name: Run Workflow
21+
id: write_file
22+
uses: timheuer/base64-to-file@v1
23+
with:
24+
fileName: 'myTemporaryFile.txt'
25+
encodedString: ${{ secrets.SOME_ENCODED_STRING }}
26+
27+
- name: Some other step
28+
uses: actions/someaction@master
29+
with:
30+
filelocation: ${{ steps.write_file.outputs.filePath }}
1431
```

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const core = __webpack_require__(470);
5757
const fs = __webpack_require__(747);
5858

5959
// get input parameter values from config
60-
var fileName = core.getInput('fileName');
60+
var fileName = process.env['TEMP'] + '\\' + core.getInput('fileName');
6161
var encodedString = core.getInput('encodedString');
6262

6363
// most @actions toolkit packages have async methods

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const core = require('@actions/core');
22
const fs = require('fs');
33

44
// get input parameter values from config
5-
var fileName = core.getInput('fileName');
5+
var fileName = process.env['TEMP'] + '\\' + core.getInput('fileName');
66
var encodedString = core.getInput('encodedString');
77

88
// most @actions toolkit packages have async methods

0 commit comments

Comments
 (0)