google / google/copybara

Mirroring tags between github repos

Open
#81 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
3.8k
Forks
345
PR merge metrics
No merged PRs in 30d

Description

It isn't clear to me how to mirror tags between two github repositories. Our current workflow for exporting source looks like this:
```python
core.workflow(
name = "exportSourceToPublic",
origin = git.github_origin(
url = privateUrl,
ref = "master",
),
destination = git.github_destination(
url = publicUrl,
fetch = "master",
push = "master",
),
origin_files = filesToPublish,
mode = "ITERATIVE",
authoring = authoring.pass_thru(defaultAuthor),
transformations = [
metadata.restore_author(),
],
)
```

All of our tags are for commits on `master`. I assumed that I could simply run this with `origin.ref = "refs/tags/"` and `destination.push = "refs/tags/"`. When I do this I get this output:
```
Task: Git Origin: Initializing local repo
WARN: No new changes to import for resolved ref: 1809e6d8aa53af7fa30146277f9b8740ab38771c
```

This makes sense as the commit already exists on `destination:master`, but I would still expect it to push it to the tag. Am I holding it wrong / is there a better way to handle this use case? Or is it a bug and it should still push to the tag?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.