JSON to GitHub Actions
Convert CI/CD workflow definitions from JSON to GitHub Actions YAML format.
Switch tool:
Examples:
💡 Paste your JSON and it converts to YAML automatically. Perfect for Kubernetes, Docker Compose, and other DevOps configurations.
Code Examples
Here's how to achieve this in different programming languages:
1// Using js-yaml library (npm install js-yaml)2import yaml from 'js-yaml';34const jsonData = `{"name": "CI", "on": {"push": {"branches": ["main"]}, "pull_request": {"branches": ["main"]}}, "jobs": {"build": {"runs-on": "ubuntu-latest", "steps": [{"uses": "actions/checkout@v4"}, {"name": "Run tests", "run": "npm test"}]}}}`;5const parsed = JSON.parse(jsonData);6const yamlOutput = yaml.dump(parsed);7console.log(yamlOutput);89// Output:10// name: CI11// on:12// push:13// branches:14// - main15// pull_request:16// branches:17// - main18// jobs:19// build:20// runs-on: ubuntu-latest21// steps:22// - uses: actions/checkout@v423// - name: Run tests24// run: npm test
More JSON Examples
JSON to Kubernetes YAML
Convert JSON deployment configuration to Kubernetes YAML format.
JSON to Docker Compose
Convert JSON service configuration to Docker Compose YAML format.
Simple JSON to YAML
Basic example of converting a JSON object to YAML.
Nested JSON to YAML
Convert deeply nested JSON configuration to YAML.