9db5b987c35fe01f98b64f6fe5e73ac8bfa552e9 — Luca Weiss 2 months ago 370650f 0.11.0
Support forks with a different repository name

Prepend the source url with a $orig_dir:: to indicate to the
builds.sr.ht worker, how the repository directory should be called.
1 files changed, 3 insertions(+), 1 deletions(-)

M dispatchsrht/tasks/github/auth.py
M dispatchsrht/tasks/github/auth.py => dispatchsrht/tasks/github/auth.py +3 -1
@@ 142,8 142,10 @@ if not manifests:
          return "There are no build manifest in this repository"
      def source_url(source):
-         if not source.endswith("/" + repo.name):
+         if not source.endswith("/" + base.name):
              return source
+         if base.name != repo.name:
+             return base.name + "::" + repo.clone_url + "#" + git_commit.sha
          if repo.private:
              return repo.ssh_url + "#" + git_commit.sha
          return repo.clone_url + "#" + git_commit.sha