I've encountered some strange behavior with GitHub Actions workflows when using a default branch that is not main or master.
I tried searching the forums but couldn’t find any similar issues — maybe I didn’t search well enough. If you’ve run into something like this, please let me know.
Maybe I’m missing something, I don’t know...
Note that sometimes it will show zero workflows — I’m not sure why that happens.
I guess GitHub needs more time than the 20-second sleep my script uses by default.
git clone git@github.com:Karuch/workflows-default-branch-bug.git
cd workflows-default-branch-bug.git
./reproduce.sh <github_username_or_org> [branch_name]
In my repository, I have two workflows — workflowA.yml (triggered on push) and workflowB.yml (triggered on workflow_dispatch) — both located under .github/workflows/.
I created a blank repository (no README.md, LICENSE, etc.)
Then I ran the following commands to initialize the repository with a first default branch named dev:
git init -b dev
git remote add origin "git@github.com:org/repo.git"
git add .
git commit -m "Initial commit"
git push -u origin devI needed the initial default branch to be dev instead of main or master.
However, I noticed that even though both workflow files exist, the workflow with workflow_dispatch (workflowB.yml) only appears intermittently in the Actions tab.
I reproduced this using the gh CLI as well — creating the repository in the same way — and observed the same behavior.
So it doesn’t seem to be just a UI issue.
To make it easier to reproduce, I created a repository containing a reproduce.sh script that:
- Creates a repository in the same way
- Lets you choose the initial branch name (so you can test with
main/masterand see that it always works there) - Checks which workflows appear
- Deletes the created repository afterward
If I create another branch and set it as the default (it doesn’t matter what I name it), GitHub seems to re-index the workflows, and then both workflows appear — even after switching the default branch back to dev.
I also created a script to reproduce this using the gh client:
./change_default_test.sh <github_username_or_org> [branch_name]All workflows in .github/workflows/ should appear in the Actions tab as soon as they exist in the default branch.

