Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[steps] Do not trim step output value #502

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/steps/bin/set-output
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ if [[ -z "$NAME" || -z "$VALUE" ]]; then
exit 2
fi

echo $VALUE > $__EXPO_STEPS_OUTPUTS_DIR/$NAME
if [[ "$OSTYPE" == "linux"* ]]; then
echo -n "$VALUE" | base64 -w 0 > $__EXPO_STEPS_OUTPUTS_DIR/$NAME
else
echo -n "$VALUE" | base64 > $__EXPO_STEPS_OUTPUTS_DIR/$NAME
fi
4 changes: 2 additions & 2 deletions packages/steps/src/BuildStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ export class BuildStep extends BuildStepOutputAccessor {

const file = path.join(outputsDir, outputId);
const rawContents = await fs.readFile(file, 'utf-8');
const value = rawContents.trim();
this.outputById[outputId].set(value);
const decodedContents = Buffer.from(rawContents, 'base64').toString('utf-8');
this.outputById[outputId].set(decodedContents);
}

const nonSetRequiredOutputIds: string[] = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/steps/src/__tests__/BuildStep-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ describe(BuildStep, () => {
command,
});
await step.executeAsync();
expect(step.getOutputValueByName('foo2')).toBe('bar linux {"foo":"bar","baz":[1,"aaa"]}');
expect(step.getOutputValueByName('foo2')).toBe('bar linux {"foo":"bar","baz":[1,"aaa"]}');
});

it('interpolates the outputs in command template', async () => {
Expand Down
Loading