The on key
A bare on is true in YAML 1.1. Quoting it as 'on' keeps every parser and linter happy.
Turn a JSON workflow definition into a clean .github/workflows file, ready to commit.
Each line of the output, in default formatting, next to the path of the value it holds. Click a row to copy the path.
Runs entirely in your browser, so nothing is uploaded. Fair-use limits apply (5 MB per input, rate-limited conversions) to prevent spam and bots.
Triggers, matrix values, expressions and multi-line scripts all come out the way you would write them by hand.
{
"name": "CI",
"on": {
"push": {
"branches": [
"main"
]
}
},
"jobs": {
"test": {
"runs-on": "ubuntu-latest",
"strategy": {
"matrix": {
"node": [
"20",
"22"
]
}
},
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"uses": "actions/setup-node@v4",
"with": {
"node-version": "${{ matrix.node }}"
}
},
{
"run": "npm ci\nnpm test\n"
}
]
}
}
} name: CI
'on':
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node:
- '20'
- '22'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: |
npm ci
npm test Switch between the converter's output and the same lines written without quotes, and compare how each YAML version reads them.
A bare on is true in YAML 1.1. Quoting it as 'on' keeps every parser and linter happy.
Matrix values like '20' or '3.10' stay quoted, so Python 3.10 never turns into 3.1.
Strings with line breaks become run: | blocks, keeping every command on its own line.
Converters, validators and step-by-step guides for every place JSON and YAML meet.
Paste the JSON into the editor, copy the YAML and save it in your repository under .github/workflows/, for example .github/workflows/ci.yml. The workflow runs on the next matching event.
In YAML 1.1, a bare on is the boolean true, so some tools read the trigger key as true instead of on. Quoting it removes the ambiguity. GitHub accepts both forms, so 'on': is safe everywhere.
Yes. Expressions such as ${{ matrix.node }} and ${{ secrets.TOKEN }} are plain strings in both JSON and YAML and are written exactly as they appear in the input.
A JSON string containing \n line breaks becomes a YAML literal block (run: |), with one command per line, which is how workflow scripts are normally written.
This converter checks YAML syntax. For workflow-specific checks such as unknown keys, invalid expressions or wrong runner labels, run actionlint locally or in CI.