Skip to content

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

Closed
@raygesualdo

Description

@raygesualdo

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy