Improved the example of Setting an Environment Var#2488
Improved the example of Setting an Environment Var#2488skedwards88 merged 7 commits intogithub:mainfrom
Conversation
|
Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines. |
|
I'm happy to help with the Spanish translation of this specific MD file as it seems that it is quite outdated... |
This comment was marked as spam.
This comment was marked as spam.
|
@espipj Thanks so much for opening a PR! I'll get this triaged for review ✨ I appreciate the offer to help with the translation! Unfortunately, we are not able to accept pull requests for translated content. Our translation process involves an integration with an external service at crowdin.com, where all translation activity happens. We hope to eventually open up the translation process to the open-source community, but we're not there yet. See https://github.com/github/docs/blob/main/CONTRIBUTING.md#earth_asia-translations for more details. |
|
This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit. |
|
Thanks for your patience! Our small team is working our way through reviewing all of the amazing contributions ✨ |
|
This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit. |
|
|
||
| ### Setting an environment variable | ||
|
|
||
| `echo "{name}={value}" >> $GITHUB_ENV` |
There was a problem hiding this comment.
I think this is a great addition! I would recommend replacing the snippet in the "Example" section. That way, users can see the syntax before seeing an example.
So lines 281-287 could instead be something like:
Example
{% raw %}
steps:
- name: Set the value
run: |
echo "action_state=yellow" >> $GITHUB_ENV
- name: Use the value
run: |
echo $action_state{% endraw %}
What do you think?
There was a problem hiding this comment.
Hey @skedwards88 actually that's a good idea, I completely missed the example bit. Changing that now :)
skedwards88
left a comment
There was a problem hiding this comment.
Looks good! The original example just needs to be deleted now, then I can get this merged down for you.
| {% raw %} | ||
| ``` | ||
| steps: | ||
| - name: Set the value | ||
| id: step_one | ||
| run: | | ||
| echo "{name}={value}" >> $GITHUB_ENV | ||
| - name: Use the value | ||
| id: step_two | ||
| run: | | ||
| echo "${{ env.name }}" | ||
| ``` | ||
| {% endraw %} |
There was a problem hiding this comment.
Just a reminder to delete the example from here now that it is below!
| {% raw %} | |
| ``` | |
| steps: | |
| - name: Set the value | |
| id: step_one | |
| run: | | |
| echo "{name}={value}" >> $GITHUB_ENV | |
| - name: Use the value | |
| id: step_two | |
| run: | | |
| echo "${{ env.name }}" | |
| ``` | |
| {% endraw %} | |
| `echo "{name}={value}" >> $GITHUB_ENV` |
|
🚀 LGTM! I'll get this merged down. |
|
Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. |
Why:
Current example is not self explanatory. I needed to browse through GitHub issues till I found actions/starter-workflows#68 (comment) which worked flawlessly.
I think this change will help loads of users of GH Actions as this (not being able to use
::set-env) is a breaking change from around early december. 😃What's being changed:
Just the example in the docs on how to set and use github env variables.
Check off the following: