Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ with:

Version tags will then be prefixed with the subpackage's name: `{PACKAGE}-v{VERSION}`, e.g., `SubpackageName-v0.2.3`. (For top-level packages, the default tag is simply `v{VERSION}`.)

**Note**: Using TagBot with a non-empty `subdir` will only work for Julia package versions
registered using the official
[Registrator](https://github.com/JuliaRegistries/Registrator.jl) (see also
[#281](https://github.com/JuliaRegistries/TagBot/issues/281) and
[#282](https://github.com/JuliaRegistries/TagBot/pull/282)).

To tag releases from a monorepo containing multiple subpackages and an optional top-level package, set up a separate step for each package you want to tag. For example, to tag all three packages in the following repository,

```
Expand Down
12 changes: 12 additions & 0 deletions tagbot/action/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ def _commit_sha_from_registry_pr(self, version: str, tree: str) -> Optional[str]
logger.info("Registry PR body did not match")
return None
commit = self._repo.get_commit(m[1])
# Handle special case of tagging packages in a repo subdirectory, in which
# case the Julia package tree hash does not match the git commit tree hash
if self.__subdir:
arg = f"{commit.sha}:{self.__subdir}"
subdir_tree_hash = self._git.command("rev-parse", arg)
if subdir_tree_hash == tree:
return commit.sha
else:
msg = "Subdir tree SHA of commit from registry PR does not match"
logger.warning(msg)
return None
# Handle regular case (subdir is not set)
if commit.commit.tree.sha == tree:
return commit.sha
else:
Expand Down