1

I found the following GitHub Actions workflow in a repository

name: Test workflow
on:
  push: ~
  pull_request:
    branches: [ dev, main ]
jobs:
  ...

I know ~ means null in YAML world, but it can represent "default value" depending on where it is used.

In GitHub Action context, what does the tilde (~) on the push event line means ? It looks like it does nothing.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Axi
  • 1,534
  • 15
  • 20

1 Answers1

1

The normal syntax for on: would be:

  on: push

Here, you need a sequence below on:, because push is not the only criteria.
However, push: itself does not need (in this instance) any more argument/sequence.
Hence, the ~ (empty sequence) used as a value.

It should be the same as

  on:
    push
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250