Pipeline trigger: rerun latest tagged pipeline

Hi everyone :wave:

We have an app (let’s call it the main repo) that has a production build & deploy pipeline, which is only triggered when a tag is deployed. This is achieved via:

only:
  - /^v.*$/
except:
  - branches

We also have two other (let’s call them side) repositories (one’s for translations and one’s for gimmicks/easter eggs like random quotes). What I’d like to achieve is to rerun the latest (semver) tag’s pipeline of main, when either of those other side repositories’ master branch receives a push. A small detail is that one of the repositories is on GitHub, but I’d be happy to get them working on GitLab first and then work from there.

I presume I’d need to use the API to trigger the pipeline. What I’ve currently set up for the side repo on GitLab is a webhook integration for push events:
https://gitlab.com/api/v4/projects/{{ID}}/ref/master/trigger/pipeline?token={{TOKEN}}

However, this will only trigger a master pipeline for our main repo. How could I get this to (also) rerun the latest tag’s pipeline?

Bonus round: how would I go about triggering this on GitHub?