$default-branch not working

I read in this article that you can use $default-branch to reference your repo’s default branch instead of having to hardcode main/master/etc. It isn’t working for me, however. Here is how I was using $default-branch as a trigger:

on:
  push:
    branches: [$default-branch]

When I merged a feature branch PR into my base branch, the workflow whose trigger I defined above never got kicked off. It was only when I changed the trigger to the following would it pick it up:

on:
  push:
    branches:
      - master

What am I doing wrong?

The documentation on custom workflow templates linked in that changelog post says this:

If you need to refer to a repository’s default branch, you can use the $default-branch placeholder. When a workflow is created using your template, the placeholder will be automatically replaced with the name of the repository’s default branch.

So $default-branch doesn’t seem to be supported in the actual workflow file.

Ah. I clearly misunderstood the intent. Thanks for clearing that up.