Skip to content

Commit 1e3e81a

Browse files
committed
feat(checkver): Add GitLab support
1 parent 04b7ce7 commit 1e3e81a

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

bin/checkver.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,24 @@ $Queue | ForEach-Object {
162162
if ($json.checkver.PSObject.Properties.Count -eq 1) { $useGithubAPI = $true }
163163
}
164164

165+
# GitLab
166+
if ($regex) {
167+
$gitlabRegex = $regex
168+
} else {
169+
$regex = '/-/tags/(?:v|V)?([\d.]+)'
170+
}
171+
if ($json.checkver -eq 'gitlab') {
172+
if (!$json.homepage.StartsWith('https://gitlab.com/')) {
173+
error "$name checkvar expects the homepage to be a GitLab"
174+
}
175+
$url = $json.checkver.gitlab.TrimEnd('/') + '/-/tags?format=atom'
176+
$regex = $gitlabRegex
177+
}
178+
if ($json.checkver.gitlab) {
179+
$url = $json.checkver.gitlab.TrimEnd('/') + '/-/tags?format=atom'
180+
$regex = $gitlabRegex
181+
}
182+
165183
# SourceForge
166184
if ($regex) {
167185
$sourceforgeRegex = $regex

schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@
292292
"format": "uri",
293293
"type": "string"
294294
},
295+
"gitlab": {
296+
"format": "url",
297+
"type": "string"
298+
},
295299
"re": {
296300
"format": "regex",
297301
"type": "string",

0 commit comments

Comments
 (0)