Triggering a Github Workflow on a new branch

Hi,

How can I trigger a workflow action when commiting on a new branch ?

Im on a feature branch, it’s only temporary, I want to rerun the Workflow Actions but It’s not triggering.

I’ve targeted all branches, but nothing is triggered.

on:

  push:

    branches:

      - '*' # matches every branch

  pull_request:

    branches:

      - '*' # matches every branch

When committing a new branch, the workflow yml file on that new branch must have the next trigger settings.

on:
  push:
    branches:
      - '*' # matches every branch
  pull_request:
    branches:
      - '*' # matches every branch
  1. When a new branch created or pushing new commit to a branch, a push event or a pull_request event occurred. And the event webhook has an associated commit SHA and Git ref.
  2. The .github/workflows directory in your repository is searched for workflow files at the associated commit SHA or Git ref. The workflow files must be present in that commit SHA or Git ref to be considered.

There is the detail explanation about what happened when triggering a workflow run: https://help.github.com/en/actions/reference/events-that-trigger-workflows#about-workflow-events