Github action for master branch and ignore all tags and first level of files


I am having trouble configuring this workflow. I want to trigger a dev workflow, when anything is pushed to master branch, except if the commit is tagged and if the changes were only made on the root directory (so that it does not trigger a new build if I only change the

I have been trying this, but it triggers everytime… Any thoughts?

      - master
      - '**'
      - '*'


From what I understand, branches, tags*, and paths* are independent triggers. Therefore the trigger works if at least one condition coincides.

You can go from the opposite.

      - '*/**'  # Run on non-root changes
    if: ${{ github.ref == 'refs/heads/master' }}
    # ...

or try to use some actions like dorny/paths-filter.

So the on: works as OR conditions…
But the way you put it, it will still run even if the commit is tagged. I would like to add an and commit is not tagged equivalent.


The documentation says this:

If you define only tags or only branches , the workflow won’t run for events affecting the undefined Git ref.

As I understand it (and have seen where I use branch filters) setting a branches filter means that the workflow won’t run for tags unless you also have tags or tags-ignore.

If you put just for master branch, it will still run for tagged pushes to master

It will run for the push to master, but not for pushing the tag.

There is no reliable way to exclude other references (tags, other branches) to a commit: You could create a job that checks if there is a tag matching the commit the workflow is currently running for, but that only works if the other reference has been pushed by the time the fetch for that check happens.