Skip to content

Commit 0a439f2

Browse files
committed
Add possibility to map some Trac keywords to GitHub labels
Doing it for all keywords is not a good idea as there are typically too many of them, but it can be still worth doing it for some selected keywords, that can now be specified in the labels config file section.
1 parent ef624ee commit 0a439f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

trac-hub

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ class Migrator
272272
labels.add(@labels.fetch('priority', Hash[])[ticket[:priority]])
273273
labels.add(@labels.fetch('severity', Hash[])[ticket[:severity]])
274274
labels.add(@labels.fetch('version', Hash[])[ticket[:version]])
275+
276+
keywords = @labels.fetch('keywords', Hash[])
277+
ticket[:keywords].split(/[,;]? +/).each do |kw|
278+
labels.add(keywords[kw])
279+
end
280+
275281
# If the field is not set, it will be nil and generate an unprocessable json
276282
labels.delete(nil)
277283

0 commit comments

Comments
 (0)