Skip to content

Commit

Permalink
Revert "fix(repo): stop trimming whitespace of inputs (#524)" (#525)
Browse files Browse the repository at this point in the history
This reverts commit 95eec42.
  • Loading branch information
danadajian authored Jan 10, 2024
1 parent 95eec42 commit a7fd137
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47554,7 +47554,7 @@ limitations under the License.

const getActionInputs = (requiredInputs = []) => {
const yamlContents = (0,external_fs_.readFileSync)(`${__dirname}/action.yml`).toString();
const inputsFromFile = getInputsFromFile(yamlContents).reduce((acc, current) => (Object.assign(Object.assign({}, acc), { [current]: (0,core.getInput)(current, { required: requiredInputs.includes(current), trimWhitespace: false }) })), {});
const inputsFromFile = getInputsFromFile(yamlContents).reduce((acc, current) => (Object.assign(Object.assign({}, acc), { [current]: (0,core.getInput)(current, { required: requiredInputs.includes(current) }) })), {});
return (0,lodash.pickBy)(inputsFromFile);
};

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/utils/get-action-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getActionInputs = (requiredInputs: string[] = []) => {
const inputsFromFile = getInputsFromFile(yamlContents).reduce(
(acc, current) => ({
...acc,
[current]: getInput(current, { required: requiredInputs.includes(current), trimWhitespace: false })
[current]: getInput(current, { required: requiredInputs.includes(current) })
}),
{}
);
Expand Down
6 changes: 3 additions & 3 deletions test/utils/get-action-inputs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ describe('getActionInputs', () => {
it('should call getInput with correct params and return expected inputs', () => {
const result = getActionInputs(requiredInputs);

expect(getInput).toHaveBeenCalledWith('input1', { required: true, trimWhitespace: false });
expect(getInput).toHaveBeenCalledWith('input2', { required: false, trimWhitespace: false });
expect(getInput).toHaveBeenCalledWith('input3', { required: false, trimWhitespace: false });
expect(getInput).toHaveBeenCalledWith('input1', { required: true });
expect(getInput).toHaveBeenCalledWith('input2', { required: false });
expect(getInput).toHaveBeenCalledWith('input3', { required: false });
expect(result).toEqual({
input1: 'input1',
input3: 'input3'
Expand Down

0 comments on commit a7fd137

Please sign in to comment.