Skip to content

Cross repo triggers how-to#9952

Open
rosieyohannan wants to merge 27 commits intomainfrom
DOCSS-2000-cross-repo-triggers
Open

Cross repo triggers how-to#9952
rosieyohannan wants to merge 27 commits intomainfrom
DOCSS-2000-cross-repo-triggers

Conversation

@rosieyohannan
Copy link
Contributor

@rosieyohannan rosieyohannan commented Feb 3, 2026

Written with Claude code for help with structure, use case and examples

Adds a how-to guide for setting up cross-repo triggers with two pathways, one in which the config is stored with the code and one in which a centralised config repo is used.

Diagrams included render like this:
Screenshot 2026-03-12 at 11 39 28
Screenshot 2026-03-12 at 11 39 36
Screenshot 2026-03-12 at 11 39 55

@rosieyohannan rosieyohannan marked this pull request as ready for review February 12, 2026 14:25
@rosieyohannan rosieyohannan requested review from a team as code owners February 12, 2026 14:25
Copy link
Contributor

@BeFunes BeFunes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple more things to double check and (maybe) tweak, I can help with that! I also would want to give it a test run.

@rosieyohannan rosieyohannan requested a review from BeFunes March 6, 2026 13:27
Copy link
Contributor

@BeFunes BeFunes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.
Just left two comments about the tag filters, lmk if you wanna chat about them

only: /.*/
----

IMPORTANT: The `filters` section is required because CircleCI does not run workflows for tags unless you explicitly specify tag filters. The pattern `/.*/` matches all tags. Both lightweight and annotated tags are supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested, and this is actually not needed because the TAG is triggering the pipeline, but the checkout reference is a branch, not a tag.
It's super confusing, but basically no tag filter is needed

Comment on lines +333 to +355
=== 4.b. Configure tag filters in your workflow

The trigger is now configured in CircleCI, but you also need to update your configuration file for your integration tests to run workflows for tags.

By default, *CircleCI does not run workflows for tags unless you explicitly specify tag filters*. For more information, see the xref:guides:orchestrate:workflows.adoc#executing-workflows-for-a-git-tag[Executing Workflows for a Git Tag] section.

In the configuration file for your consumer pipeline, add tag filters to your workflow if they are not already present. Here is an example:

.Example of a workflow with tag filters
[source,yaml]
----
workflows:
validate-library-integration:
jobs:
- your-job-name:
filters:
tags:
only: /.*/ # Matches all tags
----

The pattern `/.*/` matches all tags. Both lightweight and annotated tags are supported.

Your cross-repo trigger is now fully configured. When a tag is created in your library repository, CircleCI will trigger the consumer pipeline and run your workflows.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all of this can be removed too. I'm almost tempted to say we should leave it to avoid confusing customers, but truly - it's not needed 😢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about if I remove but then add a note that if you don't use the tag trigger but instead choose all pushes you need it? and just point people to where we explain in the workflows doc: https://circleci.com/docs/guides/orchestrate/workflows/#executing-workflows-for-a-git-tag but actually that section needs updating too to reference the ability to use a tag trigger?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the "Tag pushes" triggers is not the reason why this is not needed, it's more nuanced than that.
It's still true that when you use "Tag pushes", in a single repo situation you will need that filter.

The reason is that the filter: \n tags: filter behind the scenes looks at the pipeline value pipeline.git.tag, which is only populated if the checkout ref is a tag.
In this situation, pipeline.git.tag is empty, because we're checking out a branch (main). The fact that you're triggering through tag does not affect it.

I don't think this is how things should work, but at the moment it's the reality, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants