skip to content
Keshav Mohta

GitHub Action workflow Yaml syntax variations

/ 1 min read

variation of GitHub Workflow YAML syntax

learning GitHub Actions and reading GitHub Docs;

as I am JavaScript developer, find some variation of defining yaml file so sharing my findings here.

this works fine and my final syntax

name: markdown-lint
run-name: learning github action from workflow
on:
push:
branches:
- main
- develop

but before reaching on this; I have tried various syntax which also work, although these variation have some significance while below might be works as default, we can control the workflow using above.

assigning branches in array []

name: markdown-lint
run-name: learning github action from workflow
on:
push:
branches: ["main", "develop"]

also one liner on also works

using without branches and run-name ;

name: markdown-lint
on: push
jobs:

assign value using string

name: markdown-lint
on: "push"
jobs:

value in array [] also works

check value against on

name: markdown-lint
on: [push]
jobs: