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

Unecessary newlines added to console output #777

Closed
crazy-max opened this issue Apr 22, 2021 · 9 comments
Closed

Unecessary newlines added to console output #777

crazy-max opened this issue Apr 22, 2021 · 9 comments
Labels
bug Something isn't working core

Comments

@crazy-max
Copy link

crazy-max commented Apr 22, 2021

#772 adds newlines in step console output which seems not right to me.

Before this change:

image

After:

image

Another example with consecutive setOutput used programmatically:

image

Could it be filtered out please or at least optional?

cc. @ericsciple

Thanks

@thboop
Copy link
Collaborator

thboop commented Apr 23, 2021

The runner processes line by line so we won't be able to filter this line out without completely revamping that process, which is unlikely to be done in the near future.

We could instead add a comment that we are setting the output, does that sound better to you?

@crazy-max
Copy link
Author

@thboop

We could instead add a comment that we are setting the output, does that sound better to you?

Yes sounds better. This modification was about a security issue?

@vers-one
Copy link

vers-one commented May 6, 2022

As a workaround, you can do something like this:

console.log("::set-output name=my-output::my-value");

which is equivalent to:

core.setOutput("my-output", "my-value");

but doesn't output any empty lines to the log.

Sure, it's a hack but in my opinion the whole idea to use the standard output both for logging and for communication with the runner wasn't the best design choice in the first place.

ezzatron added a commit to ghalactic/github-release-from-tag that referenced this issue Sep 1, 2022
ezzatron added a commit to ghalactic/github-release-from-tag that referenced this issue Sep 1, 2022
@paescuj
Copy link

paescuj commented Sep 29, 2022

This should be "fixed" by #1178, right?

@crazy-max
Copy link
Author

@paescuj

process.stdout.write(os.EOL)

@paescuj
Copy link

paescuj commented Oct 1, 2022

@crazy-max

const filePath = process.env['GITHUB_OUTPUT'] || ''
if (filePath) {
return issueFileCommand('OUTPUT', prepareKeyValueMessage(name, value))
}

@crazy-max
Copy link
Author

crazy-max commented Oct 7, 2022

@paescuj

Looks like GITHUB_OUTPUT is not yet available on GitHub Runners when dumping env vars: https://github.com/crazy-max/ghaction-dump-context/actions/runs/3017190624/jobs/4850763782#step:3:10

2.298.2 would fix it I guess but still 2.296.1 being used on public runners.

@paescuj
Copy link

paescuj commented Oct 7, 2022

It seems like the workflow run you referenced has been executed 29 days ago. The public runners have been updated in the meantime and - at least in my case - the change introduced in #1178 is working properly, see for example fkirc/skip-duplicate-actions#285.

@crazy-max
Copy link
Author

Ah indeed looks good:

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

No branches or pull requests

4 participants