Use tags or tags_ignore with pull_request event

Hi folks

I’m doing a bit of a dive into GH action trigger events for something I’m working on. I’m a bit stumped as to the sequence of events on GitHub that would lead to an action that uses on.pull_request.tags to run.

The docs suggest that this is a perfectly valid trigger:

on:
  pull_request:
    tags:        
      - v1.*

The same would be true if the event was push too. I can see how this would work for push but I can’t really see how a pull_request event can interact with tags in a way that would trigger a workflow with this config.

When specifying branches for a pull_request event, the branches refer to PR activity against the base branch of the PR. The docs suggest the same is true for tags:

For a pull_request event, only branches and tags on the base are evaluated.

You can’t open a PR against a tag though so I’m not sure what this really means in reference to tags.

Basically I’d like to know what sequence of steps I would need to take in git/GitHub in order to get the example above to run. Any insight greatly appreciated!

1 Like