You may only define one of tags and tags-ignore for a single event

Hello people,

This might be extremely easy but I am totaly newbie in github actions.

I am trying to create an action to publish a package when a release tag is pushed. Action should be triggered when v* but not when v*-pre This could be expressed as if (tag == "v*" and tag != "v*-pre") .

I’ve use

on:
  push:
    tags:
      - "v*"
    tags-ignore:
      - "v*-pre"

but I get the following error

you may only define one of tags and tags-ignore for a single event

I’ve also use

on:
  push:
    tags:
      - |
        'v*'
        '!v*-pre'

But the action was not triggered at all.

Thank you in advance.

The final example was on the right track, but the patterns need to be separate list items, like so, as shown in the documentation:

on:
  push:
    tags:
      - 'v*'
      - '!v*-pre'
1 Like