Set list of branches matching pattern as output variable in GitHub Actions (yml)

Solution 1:

Using git branch --list will show you just local branches that you checkout locally.

In GitHub Action checkout action, you are usually checking out just single branch.

To get all branches despite of the checkout methods, you have to use: git branch -r and grep that one.