Skip to content

Commit 831b81d

Browse files
authored
feat: default to writing files (#19)
* feat: default to writing files * chore: run package
1 parent 8184f54 commit 831b81d

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

__tests__/helpers/getAndValidateInputs.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,32 @@ describe('getAndValidateInputs', () => {
88
jest.clearAllMocks();
99
});
1010

11+
it('defaults the output to files', () => {
12+
(core.getInput as jest.Mock).mockImplementation((name: string) => {
13+
switch (name) {
14+
case 'hxKeyFile':
15+
return 'keyfile';
16+
case 'environment':
17+
return 'production';
18+
case 'variablePrefix':
19+
return 'prefix';
20+
default:
21+
return '';
22+
}
23+
});
24+
(core.getMultilineInput as jest.Mock).mockReturnValue(undefined);
25+
26+
const result = getAndValidateInputs();
27+
28+
expect(result).toEqual({
29+
hxKeyFile: 'keyfile',
30+
environment: 'production',
31+
writeFiles: true,
32+
writeVariables: false,
33+
variablePrefix: 'prefix'
34+
});
35+
});
36+
1137
it('should return valid outputs', () => {
1238
(core.getInput as jest.Mock).mockImplementation((name: string) => {
1339
switch (name) {

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/helpers/getAndValidateInputs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function getAndValidateInputs(): {
1111
const hxKeyFile = core.getInput('hxKeyFile', { required: true });
1212
const environment = core.getInput('environment', { required: true });
1313
const variablePrefix = core.getInput('variablePrefix') || '';
14-
const outputs = core.getMultilineInput('outputs') || [];
14+
const outputs = core.getMultilineInput('outputs') || ['files'];
1515

1616
const parsedOutputs = outputs.reduce(
1717
(acc, output) => {

0 commit comments

Comments
 (0)