This is a note where I capture the various errors we receive when we create GitHub workflows that are smaller than the smallest possible workflow. I do not know why anyone would ever need this information and I doubt it will serve any purpose for me either but sometimes you just want to know things, no matter how useless they might be. This is one of the useless things I wanted to know today.
{{ toc }}For the first experiment we just create a zero byte file and push it to GitHub as follows, say, like this:
mkdir -p .github/workflows/
touch .github/workflows/hello.yml
git add .github/
git commit -m 'Empty workflow'
git push -u origin main
Under the GitHub repo's Actions tab, we find this error:
Error No event triggers defined in `on`
Then we update the workflow as follows:
on:
Now we get this error:
Invalid workflow file: .github/workflows/hello.yml#L1 (Line: 1, Col: 4): Unexpected value '', (Line: 1, Col: 1): Required property is missing: jobs
Next update:
on: push
Corresponding error:
Invalid workflow file: .github/workflows/hello.yml#L1 (Line: 1, Col: 1): Required property is missing: jobs
Workflow:
on: push
jobs:
Error:
Invalid workflow file: .github/workflows/hello.yml#L1 (Line: 2, Col: 6): Unexpected value ''
Workflow:
on: push
jobs:
world:
Error:
Invalid workflow file: .github/workflows/hello.yml#L1 (Line: 3, Col: 9): Unexpected value ''
Workflow:
on: push
jobs:
world:
steps:
Error:
Invalid workflow file: .github/workflows/hello.yml#L1 (Line: 4, Col: 11): Unexpected value '', (Line: 4, Col: 5): Required property is missing: runs-on
Workflow:
on: push
jobs:
world:
runs-on:
steps:
Error:
Invalid workflow file: .github/workflows/hello.yml#L1 (Line: 4, Col: 13): Unexpected value '', (Line: 5, Col: 11): Unexpected value ''
Workflow:
on: push
jobs:
world:
runs-on: ubuntu-latest
steps:
Error:
Invalid workflow file: .github/workflows/hello.yml#L1 (Line: 5, Col: 11): Unexpected value ''
Workflow:
on: push
jobs:
world:
runs-on: ubuntu-latest
steps: []
Error:
Invalid workflow file: .github/workflows/hello.yml#L1 No steps defined in `steps` and no workflow called in `uses` for the following jobs: world
Workflow:
on: push
jobs:
world:
runs-on: ubuntu-latest
steps:
- run:
Success:
▼ Run
shell: /usr/bin/bash -e {0}
Workflow:
on: push
jobs:
world:
runs-on: ubuntu-latest
steps:
- run: echo
Success:
▼ Run
echo
shell: /usr/bin/bash -e {0}
Workflow:
on: push
jobs:
world:
runs-on: ubuntu-latest
steps:
- run: echo hello, world
Success:
▼ Run echo hello, world
echo hello, world
shell: /usr/bin/bash -e {0}
hello, world
The experiments are preserved in the commit history of github.com/spxy/minighwf.