refactor(run): drop the unused job of a run URL

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 20:29:37 +02:00
1 parent 57cbded4a0
commit c22e8550da
2 files changed
+3 -6

No files matched your search

+2 -5
View File
@@ -35,8 +35,6 @@ const (
// ref is a parsed reference argument.
type ref struct {
Number int64
// Job is the job of a run URL ending in /jobs/M, else 0.
Job int64
// Repo is the repository the reference names, as a repository argument (a URL,
// [HOST/]OWNER/REPO or NAME); it is empty for N and #N.
Repo string
@@ -92,10 +90,9 @@ func parseRefURL(raw string, kind refKind) (ref, error) {
result := ref{}
switch {
case kind == runRef && at(i) == "actions" && at(i+1) == "runs" && positive(i+2) > 0:
// Since Gitea 1.26 the web URL holds the run ID, which the API takes too; a trailing
// /jobs/M only selects a job on the web page.
result.Number = positive(i + 2)
if at(i+3) == "jobs" {
result.Job = positive(i + 4)
}
case kind != runRef && (at(i) == "issues" || at(i) == "pulls") && positive(i+1) > 0:
result.Number = positive(i + 1)
default: