From f0b17a76cde5114f7cfe009ab29f472e59184c41 Mon Sep 17 00:00:00 2001 From: SurefireStudios Date: Mon, 14 Sep 2026 10:04:40 -0700 Subject: [PATCH] Fix invalid JSON in documentation code examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Six fenced `json` blocks across five articles do not parse. Each is a one-character fix: one missing comma and five trailing commas. The two most visible are tagged `json copy`, so the site renders a copy button on a sample that will not parse where the reader pastes it: - `customize-containers.md` is missing the comma after `"image": "node:18"`. Line 295 of the same file has the comma, so this is a typo rather than a house style. - `hooks.md` has a trailing comma after the `sessionStart` array. The rest are trailing commas, which JSON does not allow: - `expressions.md` — the `vegetables` object and the filter-result array - `publish-nodejs-packages.md` — after the `repository` object. A `package.json` with this trailing comma is rejected by npm. - `github-event-types.md` — after the `org` object Verified by parsing every fenced `json` block in `content/` before and after: these five files go from six failing blocks to zero, and no other block changes state. Blocks that are deliberately invalid were left alone, including the "common validation errors" examples, the newline-delimited JSON in `team-level-metrics.md`, and the `/* hook entries */` placeholder in `hooks-reference.md`. --- .../self-hosted-runners/customize-containers.md | 2 +- .../reference/workflows-and-actions/expressions.md | 10 +++++----- .../publish-packages/publish-nodejs-packages.md | 2 +- content/copilot/concepts/agents/hooks.md | 2 +- content/rest/using-the-rest-api/github-event-types.md | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/content/actions/how-tos/manage-runners/self-hosted-runners/customize-containers.md b/content/actions/how-tos/manage-runners/self-hosted-runners/customize-containers.md index eb5f41dc6be0..407f8cd3b752 100644 --- a/content/actions/how-tos/manage-runners/self-hosted-runners/customize-containers.md +++ b/content/actions/how-tos/manage-runners/self-hosted-runners/customize-containers.md @@ -100,7 +100,7 @@ The `prepare_job` command is called when a job is started. {% data variables.pro "state": {}, "args": { "jobContainer": { - "image": "node:18" + "image": "node:18", "workingDirectory": "/__w/octocat-test2/octocat-test2", "createOptions": "--cpus 1", "environmentVariables": { diff --git a/content/actions/reference/workflows-and-actions/expressions.md b/content/actions/reference/workflows-and-actions/expressions.md index 69a06bba99b6..e3b4af25903d 100644 --- a/content/actions/reference/workflows-and-actions/expressions.md +++ b/content/actions/reference/workflows-and-actions/expressions.md @@ -412,18 +412,18 @@ You may also use the `*` syntax on an object. For example, suppose you have an o "scallions": { "colors": ["green", "white", "red"], - "ediblePortions": ["roots", "stalks"], + "ediblePortions": ["roots", "stalks"] }, "beets": { "colors": ["purple", "red", "gold", "white", "pink"], - "ediblePortions": ["roots", "stems", "leaves"], + "ediblePortions": ["roots", "stems", "leaves"] }, "artichokes": { "colors": ["green", "purple", "red", "black"], - "ediblePortions": ["hearts", "stems", "leaves"], - }, + "ediblePortions": ["hearts", "stems", "leaves"] + } } ``` @@ -434,7 +434,7 @@ The filter `vegetables.*.ediblePortions` could evaluate to: [ ["roots", "stalks"], ["hearts", "stems", "leaves"], - ["roots", "stems", "leaves"], + ["roots", "stems", "leaves"] ] ``` diff --git a/content/actions/tutorials/publish-packages/publish-nodejs-packages.md b/content/actions/tutorials/publish-packages/publish-nodejs-packages.md index 429958fe46a3..ff49fab2c1ce 100644 --- a/content/actions/tutorials/publish-packages/publish-nodejs-packages.md +++ b/content/actions/tutorials/publish-packages/publish-nodejs-packages.md @@ -110,7 +110,7 @@ If you do provide the `repository` key in your `package.json` file, then the rep "repository": { "type": "git", "url": "https://github.com/octocat/my-other-repo.git" - }, + } } ``` diff --git a/content/copilot/concepts/agents/hooks.md b/content/copilot/concepts/agents/hooks.md index 9597e031f628..672e2d5a4d8e 100644 --- a/content/copilot/concepts/agents/hooks.md +++ b/content/copilot/concepts/agents/hooks.md @@ -62,7 +62,7 @@ You configure hooks using a special JSON format. The JSON must contain a `versio "env": { "KEY": "value" }, "timeoutSec": 30 } - ], + ] } } ``` diff --git a/content/rest/using-the-rest-api/github-event-types.md b/content/rest/using-the-rest-api/github-event-types.md index 949b6342ff49..50e88747582b 100644 --- a/content/rest/using-the-rest-api/github-event-types.md +++ b/content/rest/using-the-rest-api/github-event-types.md @@ -89,7 +89,7 @@ Link: ; rel="next", "gravatar_id": "", "url": "https://api.github.com/orgs/github", "avatar_url": "https://github.com/images/error/octocat_happy.gif" - }, + } } ] ```