-
Notifications
You must be signed in to change notification settings - Fork 58.9k
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
Add environment name expression example #23816
Conversation
I spent hours and hours figuring this out on my own, I hope this saves someone else a day! Would also like someone at github to actually clarify what contexts are available here.
|
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. |
|
@ssyberg Thanks for opening an issue. We appreciate your interest in improving the Docs! ✨ I'll get this triaged, but would you mind filling in a bit more information in the "Why" section above? A bit more context about the problem you are solving with this submission will really help us in the review process. Thank you! 👍 |
Sure, not much to say that isn't in the content change itself but I added it above as well. |
|
This is super helpful! Thank you! ✨ |
This comment was marked as spam.
This comment was marked as spam.
| @@ -27,3 +27,13 @@ environment: | |||
| url: ${{ steps.step_id.outputs.url_output }} | |||
| ``` | |||
| {% endraw %} | |||
|
|
|||
| The `name` can also be an expression but the available contexts are not currently documented. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the available contexts are not currently documented.
I've asked the Actions team about this so that we can provide the details of contexts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contexts for name:
"github","inputs","vars","needs","strategy","matrix"
For precision, we should also update the contexts for url to give the actual list of contexts, rather than say "except for the secrets context".
"github","inputs","vars","needs","strategy","matrix","steps","job","runner","env"
jobs.<job_id>.concurrency has the same set of contexts as name (https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idconcurrency) so we should update this also - replacing "except for the secrets context".
data/reusables/actions/jobs/section-using-environments-for-jobs.md
Outdated
Show resolved
Hide resolved
data/reusables/actions/jobs/section-using-environments-for-jobs.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssyberg - Many thanks for raising this PR to improve the docs.
I'm sorry it's taken us so long to get to reviewing it.
After checking with the Actions team, I've added details about the contexts for expressions used for name - and, on advice, I've also changed the contexts information in a couple of other places.
A tip I was given, which might be helpful if you use VS Code, is that, with the Actions extension for VS Code, you can find out context information in a tooltip when you hover over a keyword:
|
Merging this now. 🚢 |
|
Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues ⚡ |
I spent hours and hours figuring this out on my own, I hope this saves someone else a day! Would also like someone at github to actually clarify what contexts are available here.
Why:
Documentation on use of expessions in the
namevalue ofenvironmentincomplete / missing completely from any Github Actions related docs.The
nameattribute can actually be an expression but the available contexts are not currently documented (this issue persists even after my changes).What's being changed (if available, include any code snippets, screenshots, or gifs):
Documentation
Check off the following: