Action does not run on master with tags-ignore v*

I have a workflow that does not run on master after adding tags-ignore to on/push. When I remove the tags-ignore it does run again. When I re-add it it does not run.

I want to ignore tags so it does not run when I create a release tag.

Any idea why this is happening?

name: build

on:
  push:
    paths-ignore:
      - 'LICENSE'
      - 'README.adoc'
      - 'docs/**'
   tags-ignore:
     - v*

here is the workflow file:

The asterisk is a special character in YAML. It is used in conjunction with &, which defines an anchor, that can then be referenced it with *. I’m not sure if it causes your problem, as the string isn’t starting with an asterisk, but you should try to wrap the value in quotes:

    tags-ignore:
      - 'v*'

https://yaml.org/spec/1.2/spec.html#*%20alias//

Thanks,

tried it, but unfortunately it does not help.

Looking at the docs, the tags are written without the quotes: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags

So that doesn’t seem to be the problem. Strange.

Weird. It should run whenever you push a commit to any branch, with at least one file not matching paths-ignore. You are not using a forked repo are you?

What if you remove tags-ignore completely and use a negated tag glob instead?

tags:
  - '!v*'

The documentation says:

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

Your workflow has an explicit rule for tags, but not for branches, so I assume that’s the reason. Try adding

branches:
  - '**'

to the push event to build on all branch pushes.

2 Likes

Tried it, it does not help. After removing the tags stuff it runs again.

The repo is not forked, but I moved it to an organization a while ago.

Looks like that was the trick, now it runs! Thanks.

1 Like