Can we specify the default branch in workflows?

I want to provide an example workflow for my GitHub Action and it would be nice to be able to just write default in the workflow and it would resolve to master or main or whatever else is the name of the default branch.

We support a macro in templates for that But not at runtime.

1 Like

I tried to use it in my workflow:

name: Deploy

    branches: [ $default-branch ]
    branches: [ $default-branch, 'production' ]

But workflow is not triggered when a PR is submitted. Any idea ?