Is it possible to change the default branch in Github Actions Manual Workflow?

Hello!
I have Manual Workflow in Github Actions(GA).
When i need to run it - i open GA and choose Action, then press Run Workflow
Then i need to choose a branch if it is not default branch.


It’s ok - when there is one or two branches. But when it’s a lot of them…

Question: Is there any way to reassign default branch in workflow file?
And when i choose another branch - i will have by default the branch from which I run.

Thank you!

Hi @kobrikx,

Glad to see you in Github Community Forum!

It’s NOT supported to reassign default branch in workflow file. You can change the default branch in repository settings to achieve this.

If you’d like to choose another branch, you can create same name workflow file in both default branch and target branch.
For example, in default branch, you have a workflow file checkworkflowd.yaml, code as below:

name: try workflow
on:
  workflow_dispatch:
......

In the dev branch, you need to have a same name workflow file checkworkflowd.yaml. Code as below:

name: test workflow dispatch
on:
  workflow_dispatch:
    inputs:
      username:
        description: 'Person to greet'
        required: true
        default: 'Mona the Octocat'
.........

When you maunally trigger the workflow, you can choose the dev branch, the input will appear at the same time.
image

Thanks

Thank you very much. Your answer brought me out of the logical impasse associated with lack of information.
:slight_smile: