Convert a GitHub Actions workflow between YAML and JSON
A .github/workflows/*.yml file converted to JSON for programmatic generation, drift-checking, or audit. GitHub also accepts the same schema as JSON if the action runner can read it.
# context
GitHub Actions workflows live in .github/workflows as YAML, but the schema is identical when expressed as JSON. Teams that generate workflows from a CDK-style tool produce JSON first; this converter is the round-trip check before committing.
# sample (JSON)
{
"name": "CI",
"on": {
"push": { "branches": ["main"] },
"pull_request": {}
},
"jobs": {
"build": {
"runs-on": "ubuntu-latest",
"steps": [
{ "uses": "actions/checkout@v4" },
{
"uses": "actions/setup-node@v4",
"with": { "node-version": "22" }
},
{ "run": "npm ci" },
{ "run": "npm test" }
]
}
}
} → Open in JSON ↔ YAML converter (pre-filled)
# notes
- The `on` field accepts multiple shapes (string, list, map). The converter preserves whichever you start with.
- Step names with colons or special chars need quoting in YAML: name: "Build & test" — already safe in JSON.
- GitHub does not accept @hourly / @daily cron macros — translate to explicit 5-field cron expressions.