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

Extra newline character in version output when reading from a file #618

Closed
2 of 5 tasks
raygesualdo opened this issue Oct 31, 2022 · 4 comments
Closed
2 of 5 tasks
Assignees
Labels
bug Something isn't working

Comments

@raygesualdo
Copy link

raygesualdo commented Oct 31, 2022

Description:

When reading the version from a file (specifically .tool-versions in this case), an extra newline character is included in the step output. When using the output in subsequent steps - for instance, using the version output as part of a cache key - the newline character is included. While this doesn't break the caching step, including the newline character did cause issues with some automated tooling we were building around cache management.

Action version:

v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

node: 16.16.0

Repro steps:

I created a repo to repro the issue:

When looking at the actions run summary, one can see the additional \n right after the version (v16.16.0) in the cache keys.

Expected behavior:

The version output should be the exact version string with no additional whitespace.

Actual behavior:

The version output includes an additional newline character (\n) in the output.


The fix seems to be adding a .trim() here before returning the parsed version. I can create a PR if that path forward is acceptable.

@raygesualdo raygesualdo added bug Something isn't working needs triage labels Oct 31, 2022
@dmitry-shibanov
Copy link
Contributor

Hello @raygesualdo. Thank you for your report. We'll investigate the issue.

@Blackbaud-SteveBrush
Copy link

We're also seeing this when using an .nvmrc file. The cache step creates two keys, one before the newline character, and one after.

@dsame dsame self-assigned this Nov 16, 2022
@dsame
Copy link
Contributor

dsame commented Dec 7, 2022

Hello @raygesualdo i close the issue as solved with PR #625 but please feel free to reopen this issue or create new one if the problem still exists

@dsame dsame closed this as completed Dec 7, 2022
@raygesualdo
Copy link
Author

Thanks @dsame!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants