On push action does not execute when new branch is created

I have a Github action workflow that should get triggered on push. It works fine for new commits added to an existing branch but it skips execution when I try to create a new branch. I suspect the paths-ignore filter is the problem here. I want it to execute on new branch creation as well. I have already tried on create event but that introduces another problem. When I publish a new release the build gets executed which should not happen.
Can anyone help me figure out how to tackle this problem?

name: build

on:
  push:
    paths-ignore:
    - 'docs/**'
    - 'deploy/helm/**'
    - 'changelogs/**'

1 Like

Check out Action on newly created branch

1 Like
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

We use the this for CI, which only triggers the flow when:

  1. A pull request that was merged on master (or if someone pushes direct to master, which is not permitted in our repo)
  2. When a pull request on a branch targeting master is created.

Having our CI run on a new branch is not very useful as there is no new commits, thus no new code to run CI over. Your use case may be different tho.