From 4ce6cfff28d5f69777bb64fe94be01aefeac7939 Mon Sep 17 00:00:00 2001 From: Kurt von Laven Date: Mon, 21 Feb 2022 15:50:45 -0800 Subject: [PATCH 1/5] Add example for object filter on object. There was already an example for using an object filter on an array. Clarify that object filters can be used on objects as well and that the result is an array, not an object. --- .../learn-github-actions/expressions.md | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/content/actions/learn-github-actions/expressions.md b/content/actions/learn-github-actions/expressions.md index 7409db10e10f..14fe4cc00b1e 100644 --- a/content/actions/learn-github-actions/expressions.md +++ b/content/actions/learn-github-actions/expressions.md @@ -366,4 +366,40 @@ For example, consider an array of objects named `fruits`. ] ``` -The filter `fruits.*.name` returns the array `[ "apple", "orange", "pear" ]` +The filter `fruits.*.name` returns the array `[ "apple", "orange", "pear" ]`. + +You may also use the `*` syntax on an object. For example, suppose you have an object named `vegetables`. + +```json + +{ + "scallions": + { + "colors": ["green", "white", "red"], + "ediblePortions": ["roots", "stalks"], + }, + "beets": + { + "colors": ["purple", "red", "gold", "white", "pink"], + "ediblePortions": ["roots", "stems", "leaves"], + }, + "artichokes": + { + "colors": ["green", "purple", "red", "black"], + "ediblePortions": ["hearts", "stems", "leaves"], + }, +} +``` + +The filter `vegetables.*.ediblePortions` could evaluate to: + +```json + +[ + ["roots", "stalks"], + ["hearts", "stems", "leaves"], + ["roots", "stems", "leaves"], +] +``` + +Since objects don't preserve order, the order of the output can not be guaranteed. From 75c3d285bafce56f045a815c471165340e0a6692 Mon Sep 17 00:00:00 2001 From: hubwriter Date: Thu, 24 Mar 2022 15:37:52 +0000 Subject: [PATCH 2/5] Update content-style-guide.md --- contributing/content-style-guide.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contributing/content-style-guide.md b/contributing/content-style-guide.md index 3dc7b2d444c7..7de5d81f30e0 100644 --- a/contributing/content-style-guide.md +++ b/contributing/content-style-guide.md @@ -365,7 +365,7 @@ steps: Examples: - See the code block in "[Publishing to package registries](https://docs.github.com/en/actions/guides/building-and-testing-python#publishing-to-package-registries)" -### Pinning version numbers to SHA +#### Pinning version numbers to SHA Code examples that use third-party actions must always pin to a full length commit SHA, instead of the version number or branch: @@ -383,6 +383,12 @@ steps: For more information, see "[Using SHAs](https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions#using-shas)" +### GitHub Codespaces + +Always use "GitHub Codespaces" (`{% data variables.product.prodname_github_codespaces %}`) as the product name, not just "Codespaces". This helps to avoid confusion with "codespaces" (lowercase c), which refers to instances of remote coding workspaces created with GitHub Codespaces. + +Always use "dev container" (or its longer form "development container) and not "devcontainer" (one word), except in file/path names. Although "devcontainer" is very commonly used internally within GitHub, Microsoft have specifically asked us not to use this form in publicly visible places as the single word could be considered its own brand, which we want to avoid, and we also want to be consistent with the two-word form used in [the Visual Studio Code documentation](https://code.visualstudio.com/docs/remote/create-dev-container#_path-to-creating-a-dev-container). + ## Punctuation Follow standard American English punctuation rules. For more guidance, see “[Punctuation](https://brand.github.com/content/grammar#punctuation)” in GitHub’s Brand Guide and “[Punctuation](https://docs.microsoft.com/style-guide/punctuation)” in the Microsoft Style Guide. From 7e1ca3c488844a2f46bd7abc3c84bb30170eba8b Mon Sep 17 00:00:00 2001 From: hubwriter Date: Thu, 24 Mar 2022 15:40:14 +0000 Subject: [PATCH 3/5] Update content-style-guide.md --- contributing/content-style-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/content-style-guide.md b/contributing/content-style-guide.md index 7de5d81f30e0..1b47c7276b12 100644 --- a/contributing/content-style-guide.md +++ b/contributing/content-style-guide.md @@ -387,7 +387,7 @@ For more information, see "[Using SHAs](https://docs.github.com/en/actions/learn Always use "GitHub Codespaces" (`{% data variables.product.prodname_github_codespaces %}`) as the product name, not just "Codespaces". This helps to avoid confusion with "codespaces" (lowercase c), which refers to instances of remote coding workspaces created with GitHub Codespaces. -Always use "dev container" (or its longer form "development container) and not "devcontainer" (one word), except in file/path names. Although "devcontainer" is very commonly used internally within GitHub, Microsoft have specifically asked us not to use this form in publicly visible places as the single word could be considered its own brand, which we want to avoid, and we also want to be consistent with the two-word form used in [the Visual Studio Code documentation](https://code.visualstudio.com/docs/remote/create-dev-container#_path-to-creating-a-dev-container). +Always use "dev container" (or its longer form "development container) and not "devcontainer" (one word), except in file/path names. The single word could form could be considered a brand, which we want to avoid, and we also want to be consistent with the two-word form used in [the Visual Studio Code documentation](https://code.visualstudio.com/docs/remote/create-dev-container#_path-to-creating-a-dev-container). ## Punctuation From 74a8f97084c1a4917f94531beb785508f170af15 Mon Sep 17 00:00:00 2001 From: hubwriter Date: Thu, 24 Mar 2022 15:42:56 +0000 Subject: [PATCH 4/5] Update content-style-guide.md --- contributing/content-style-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/content-style-guide.md b/contributing/content-style-guide.md index 1b47c7276b12..582dd95737fc 100644 --- a/contributing/content-style-guide.md +++ b/contributing/content-style-guide.md @@ -387,7 +387,7 @@ For more information, see "[Using SHAs](https://docs.github.com/en/actions/learn Always use "GitHub Codespaces" (`{% data variables.product.prodname_github_codespaces %}`) as the product name, not just "Codespaces". This helps to avoid confusion with "codespaces" (lowercase c), which refers to instances of remote coding workspaces created with GitHub Codespaces. -Always use "dev container" (or its longer form "development container) and not "devcontainer" (one word), except in file/path names. The single word could form could be considered a brand, which we want to avoid, and we also want to be consistent with the two-word form used in [the Visual Studio Code documentation](https://code.visualstudio.com/docs/remote/create-dev-container#_path-to-creating-a-dev-container). +Always use "dev container" (or, where clarification is needed, its longer form "development container") and not "devcontainer" (one word), except in file/path names. The single word could form could be considered a brand, which we want to avoid, and we also want to be consistent with the two-word form used in [the Visual Studio Code documentation](https://code.visualstudio.com/docs/remote/create-dev-container#_path-to-creating-a-dev-container). ## Punctuation From a980e8037dfca61dea25796f542ea5c0fad93ee9 Mon Sep 17 00:00:00 2001 From: hubwriter Date: Thu, 24 Mar 2022 16:04:59 +0000 Subject: [PATCH 5/5] Update content-style-guide.md --- contributing/content-style-guide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contributing/content-style-guide.md b/contributing/content-style-guide.md index 582dd95737fc..2f290039ee8e 100644 --- a/contributing/content-style-guide.md +++ b/contributing/content-style-guide.md @@ -389,6 +389,8 @@ Always use "GitHub Codespaces" (`{% data variables.product.prodname_github_codes Always use "dev container" (or, where clarification is needed, its longer form "development container") and not "devcontainer" (one word), except in file/path names. The single word could form could be considered a brand, which we want to avoid, and we also want to be consistent with the two-word form used in [the Visual Studio Code documentation](https://code.visualstudio.com/docs/remote/create-dev-container#_path-to-creating-a-dev-container). +Use "development container configuration files" to refer to all of the files in the `.devcontainer` directory (plus the `.devcontainer.json` if that's being used rather than `devcontainer.json` in the `.devcontainer` directory). Don't refer to these as "development container files" or "devcontainer files" to avoid this being taken as referring to `devcontainer.json` files. "Development container configuration files" refers to all of the files that can be used to configure a dev container, including `Dockerfile` and `docker-compose.yml` files. Don't use "the development container configuration file" (singular) when referring specifically to a `devcontainer.json` file. Instead refer to this file by its name. + ## Punctuation Follow standard American English punctuation rules. For more guidance, see “[Punctuation](https://brand.github.com/content/grammar#punctuation)” in GitHub’s Brand Guide and “[Punctuation](https://docs.microsoft.com/style-guide/punctuation)” in the Microsoft Style Guide.