On Thu, Sep 18, 2025 at 11:58:56AM +0800, Chow Loong Jin wrote:
> Package: devscripts
> Version: 2.25.19ubuntu2
> Severity: normal
> When using the following debian/watch file:
> 
> --- debian/watch --
> Version: 5
> 
> Template: Github
> Owner: prusa3d
> Project: prusaslicer
> Release-Only: yes
> ---
...
> This is wrong, because according to
> https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28, this
> actually means it's trying to search for git refs matching
> `refs/release/*`, which don't exist.
> 
> Instead, the URL to search should be
> https://api.github.com/repos/prusa3d/prusaslicer/releases, which
> actually lists the releases for the project, along with tarball links.

Hi all,

Seems that attached patch helps with the 'Release-Only' problem in rdma-core
and nextcloud-desktop, using pure template watch files.

It however does not help with slic3r-prusa because of the "version_" prefix.

Hope this helps,

-- 
Agustin
>From 01b696b3ac4376eb1e13e0d279d9cb5b008c6739 Mon Sep 17 00:00:00 2001
From: Agustin Martin Domingo <[email protected]>
Date: Sat, 28 Mar 2026 17:48:00 +0100
Subject: [PATCH] Github.pm: Use proper url with Release-Only: yes'.

---
 lib/Devscripts/Uscan/Templates/Github.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/Devscripts/Uscan/Templates/Github.pm b/lib/Devscripts/Uscan/Templates/Github.pm
index e5b9d80c..30f1c07c 100644
--- a/lib/Devscripts/Uscan/Templates/Github.pm
+++ b/lib/Devscripts/Uscan/Templates/Github.pm
@@ -16,10 +16,12 @@ sub transform {
         $dist = "https://api.github.com/repos/$owner/$project";;
     }
 
-    $watchSource->{source} ||= "$dist/git/matching-refs/"
-      . ($watchSource->{releaseonly} ? 'release/' : 'tags/');
+    $watchSource->{source} ||= "$dist/"
+      . ($watchSource->{releaseonly} ? 'releases' : 'git/matching-refs/tags/');
     $watchSource->{matchingpattern}
-      ||= 'https://api.github.com/repos/[^/]+/[^/]+/git/refs/tags/(?>[^/]+(?<=(?:\D|alpha|beta|rc))\-)?'
+      ||= 'https://api.github.com/repos/[^/]+/[^/]+/'
+      . ($watchSource->{releaseonly} ? 'tarball/' : 'git/refs/tags/')
+      . '(?>[^/]+(?<=(?:\D|alpha|beta|rc))\-)?'
       . $watchSource->{versiontype}
       . '(?:(?=")|$)';
     $watchSource->{downloadurlmangle}
-- 
2.47.3

Reply via email to