Github issues迁移,标记

This commit is contained in:
xxq250 2023-12-18 10:54:47 +08:00
parent c6a38c06d0
commit 5fe9719cc9
1 changed files with 3 additions and 4 deletions

View File

@ -175,7 +175,9 @@ namespace :batch_add_issues do
# Issue的状态: open开启的, progressing(进行中), closed关闭的, rejected拒绝的。 默认: open
lists.each do |issue|
next if issue['pull_request'].present?
created_issue = Issue.find_by(project_id: project.id, subject: issue['title'])
title = issue['title']
title = title[0..190] if title.size > 190
created_issue = Issue.find_by(project_id: project.id, subject: title)
unless created_issue.present?
priority = [1, 2, 3, 4].include?(issue['priority'].to_i) ? issue['priority'].to_i : 2
issue_status = ["", "open", "progressing", "", "", "closed", "rejected"].index(issue['state'])
@ -211,9 +213,6 @@ namespace :batch_add_issues do
end
end
title = issue['title']
title = title[0..190] if title.size > 190
issue_params = {
:status_id => issue_status,
:priority_id => priority,