This document describes the JSON data files used by the language service packages and how they are maintained.
The language service uses several JSON files containing schema definitions, webhook payloads, and other metadata. To reduce bundle size, these files are:
- Optimized at generation time — unused events are dropped, unused fields are stripped
- Minified at build time — whitespace is removed to produce
.min.jsonfiles
The source .json files are human-readable and checked into the repository. The .min.json files are generated during build and gitignored.
| File | Description |
|---|---|
src/context-providers/events/webhooks.json |
Webhook event payload schemas for autocompletion |
src/context-providers/events/objects.json |
Deduplicated shared object definitions referenced by webhooks |
src/context-providers/events/schedule.json |
Schedule event context data |
src/context-providers/events/workflow_call.json |
Reusable workflow call context data |
src/context-providers/descriptions.json |
Context variable descriptions for hover |
| File | Description |
|---|---|
src/workflow-v1.0.json |
Workflow YAML schema definition |
The webhooks.json and objects.json files are generated from the GitHub REST API description:
cd languageservice
npm run update-webhooksThis script:
- Fetches webhook schemas from the GitHub API description
- Validates all events are categorized (fails if new events are found)
- Drops events that aren't valid workflow triggers (see Dropped Events)
- Strips unused fields like
descriptionandsummary(see Stripped Fields) - Deduplicates shared object definitions into
objects.json - Writes the optimized, pretty-printed JSON files
When GitHub adds a new webhook event, the script will fail with an error like:
ERROR: New webhook event(s) detected!
The following events are not categorized:
- new_event_name
Action required:
1. Check if the event is a valid workflow trigger
2. Add the event to DROPPED_EVENTS or KEPT_EVENTS
To resolve:
-
Edit
languageservice/script/webhooks/index.ts:- Add to
KEPT_EVENTSif it's a valid workflow trigger - Add to
DROPPED_EVENTSif it's GitHub App or API-only
- Add to
-
Run
npm run update-webhooksand commit the changes
To see all available fields and events before optimization:
npm run update-webhooks -- --allThis generates webhooks.all.json and objects.all.json (gitignored) containing the complete unprocessed data from the GitHub API.
The other JSON files (schedule.json, workflow_call.json, descriptions.json, workflow-v1.0.json) are manually maintained.
At build time, all JSON files are minified (whitespace removed) to produce .min.json versions:
npm run minify-jsonThis runs automatically via prebuild and pretest hooks, so you don't need to run it manually.
The code imports the minified versions:
import webhooks from "./events/webhooks.min.json"CI verifies that generated source files are up-to-date:
- Runs
npm run update-webhooksto regenerate webhooks.json and objects.json - Checks for uncommitted changes with
git diff --exit-code
The .min.json files are generated at build time and are not committed to the repository.
If the build fails, run cd languageservice && npm run update-webhooks locally and commit the changes.
Webhook events that aren't valid workflow on: triggers are dropped (e.g., installation, ping, member, etc.). These are GitHub App or API-only events.
See DROPPED_EVENTS in script/webhooks/index.ts for the full list.
Unused fields are stripped to reduce bundle size. For example:
// Before (from webhooks.all.json)
{
"type": "object",
"name": "issue",
"in": "body",
"description": "The issue itself.",
"isRequired": true,
"childParamsGroups": [...]
}
// After (webhooks.json)
{
"name": "issue",
"description": "The issue itself.",
"childParamsGroups": [...]
}Only name, description, and childParamsGroups are kept — these are used for autocompletion and hover docs.
To compare all fields vs stripped, run npm run update-webhooks -- --all and diff the .all.json files against the regular ones.
See EVENT_ACTION_FIELDS and BODY_PARAM_FIELDS in script/webhooks/index.ts to modify what gets stripped.
The workflow-v1.0.json schema defines which activity types are valid for each workflow trigger event. A test in workflow-parser/src/schema-sync.test.ts verifies these stay in sync with webhooks.json.
If the schema-sync test fails, you'll see an error like:
Event "pull_request" is missing activity type "new_activity" in workflow-v1.0.json
To resolve:
-
Check Events that trigger workflows to verify the activity type is a valid workflow trigger:
- Find the event section (e.g., "pull_request")
- Look at the "Activity types" table — it lists which types can be used in
on.<event>.types - If the type is listed there, it's a valid workflow trigger
- If the type only appears in webhook docs but NOT in the workflow trigger docs, it's webhook-only
-
If it IS a valid workflow trigger:
- Edit
workflow-parser/src/workflow-v1.0.json - Find the
<event>-activity-typedefinition (e.g.,pull-request-activity-type) - Add the new activity type to
allowed-values - Update the
descriptionin<event>-activityto list all types - Run
npm testto regenerate the minified JSON
- Edit
-
If it is NOT a valid workflow trigger (webhook-only):
- Edit
workflow-parser/src/schema-sync.test.ts - Add the type to
WEBHOOK_ONLYfor that event
- Edit
The test tracks several types of known discrepancies:
| Category | Purpose | Example |
|---|---|---|
WEBHOOK_ONLY |
Types in webhooks that aren't valid workflow triggers | check_suite.requested |
SCHEMA_ONLY |
Types valid for workflows but missing from webhooks | registry_package.updated |
NAME_MAPPINGS |
Different names for the same concept | project_column: webhook uses edited, schema uses updated |
The test checks both directions:
- webhooks → schema: Ensures all webhook activity types are in the schema (or listed in
WEBHOOK_ONLY) - schema → webhooks: Ensures the schema doesn't have types that don't exist in webhooks (or listed in
SCHEMA_ONLYorNAME_MAPPINGS)