Skip to content

Fix missing echo call for powershell #38663

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

Closed
wants to merge 1 commit into from

Conversation

Totto16
Copy link

@Totto16 Totto16 commented May 31, 2025

Why:

I found this issue, while reading the docs

What's being changed (if available, include any code snippets, screenshots, or gifs):

If you use "<whatever>" | Out-File -FilePath "$env:GITHUB_PATH" -Append you need to add an echo to the command before the pipe (|)

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

Copy link
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions.md fpt
ghec
ghes@ 3.17 3.16 3.15 3.14 3.13
fpt
ghec
ghes@ 3.17 3.16 3.15 3.14 3.13

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label May 31, 2025
@Sharra-writes
Copy link
Contributor

Thanks for opening a PR! I'll get this triaged for review.

@Sharra-writes Sharra-writes added content This issue or pull request belongs to the Docs Content team github_actions Pull requests that update GitHub Actions code and removed triage Do not begin working on this issue until triaged by the team labels Jun 2, 2025
Copy link

@pingguomc pingguomc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I also noticed this issue. We need it.

@Sharra-writes
Copy link
Contributor

@Totto16 According to everyone I've talked to, all the documentation I've been able to find, and a Stack Overflow question someone unearthed for me, the Out-File cmdlet sends outputs to a file without the need for "echo."

@Totto16
Copy link
Author

Totto16 commented Jun 6, 2025

@Totto16 According to everyone I've talked to, all the documentation I've been able to find, and a Stack Overflow question someone unearthed for me, the Out-File cmdlet sends outputs to a file without the need for "echo."

Oh shit, then I'm sorry, I Just thought it doesn't make sense, since a pure string as command piped into another command isn't the same as echo "<some string>" | whatever ( at least on every "normal" shell in the world) . It didn't work for me in an github action, but it might be, that I not only added the echo, but also fixed another problem, and that was the correct fix for the error. I am not sure anymore 😓

Anyway, if you can confirm, that it also works without echo, I'll close this PR, again sorry for not checking it myself and coming to the same conclusion.

@Sharra-writes
Copy link
Contributor

@Totto16 It's not a problem. According to Copilot (which, you know, take everything it says with a grain of salt - I started there but double-checked with multiple other people), PowerShell is unusual in this respect. I can't actually check myself because I'm on a Mac and so is most of the rest of GitHub. If you can double check that would be awesome, but if not my inquiries are still open and several actual experts have been pinged. Not sure if people are just bored on a Friday or what, but like three people jumped on this one with pings to additional people, so... 🤷‍♀️

@Totto16
Copy link
Author

Totto16 commented Jun 6, 2025

@Totto16 It's not a problem. According to Copilot (which, you know, take everything it says with a grain of salt - I started there but double-checked with multiple other people), PowerShell is unusual in this respect. I can't actually check myself because I'm on a Mac and so is most of the rest of GitHub. If you can double check that would be awesome, but if not my inquiries are still open and several actual experts have been pinged. Not sure if people are just bored on a Friday or what, but like three people jumped on this one with pings to additional people, so... 🤷‍♀️

I Just double checked it in the CI, both works (with and without echo), so I'll close this PR. Thanks for all the help.
For reference, I just ran the CI here

@Totto16 Totto16 closed this Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants