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

Shell not indicated in some examples, missing alternative shell solutions #253

Open
Simran-B opened this issue Oct 8, 2020 · 4 comments
Open

Comments

@Simran-B
Copy link
Contributor

@Simran-B Simran-B commented Oct 8, 2020

What article on docs.github.com is affected?

For instance, Actions - Workflow commands: Setting an environment variable does not say that the examples are bash specific. They won't work as-is in cmd or powershell on Windows.

What part(s) of the article would you like to see updated?

  • Tell the user what shell an example is for if it's not compatible with all standard terminals
  • Ideally provide examples for other shells as well

Additional information

In Workflow syntax for GitHub Actions there is actually a great example of how it should be:

Examples which indicate intended shell

@welcome
Copy link

@welcome welcome bot commented Oct 8, 2020

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage label Oct 8, 2020
@github-actions github-actions bot added this to Triage in Docs team reviews Oct 8, 2020
@Simran-B
Copy link
Contributor Author

@Simran-B Simran-B commented Oct 8, 2020

On second thought, I think it would make more sense to have tabs similar to the platform specific content, but render the tabs for each example group instead of once at the top of the page:

image

Changing the tab should be reflected by all other shell-specific examples. I'll try to implement a prototype. I think it will require nested Liquid tags? Let me know if you can think of another way.

### About workflow commands

{% shelltabs %}

{% bash %}

`echo "{name}={value}" >> $GITHUB_ENV`

{% endbash %}

{% pwsh %}

`echo "{name}={value}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8`

{% endpwsh %}

{% cmd %}

`chcp 65001 > nul & echo {name}={value} >> %GITHUB_ENV%`

{% endcmd %}

{% endshelltabs %}
@zeke zeke added the windows label Oct 8, 2020
@Simran-B
Copy link
Contributor Author

@Simran-B Simran-B commented Oct 8, 2020

Hard-coding it to shells might actually allow this to be implemented without nesting tags, but I'm in favor of a generic tab widget solution. I believe that it will require a group name to correctly update related example groups, and to avoid switching tabs of unrelated groups with an equally named tab. Something along:

{% tabs "shell" %}
{% tab "Bash" %} ... {% endtab %}
{% tab "PowerShell" %} ... {% endtab %}
{% tab "Windows `cmd`" %} ... {% endtab %}
{% endtabs %}
@janiceilene janiceilene moved this from Triage to Ecosystem in Docs team reviews Oct 8, 2020
@janiceilene
Copy link
Contributor

@janiceilene janiceilene commented Oct 8, 2020

Thanks for opening an issue @Simran-B! I'll let the @github/docs-content-ecosystem review 💛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.