Skip to content

Commit

Permalink
Autodetect version tags
Browse files Browse the repository at this point in the history
Towards coreinfrastructure#2139. Still draft because it needs updates to the
unit tests (/VCR) but I ran into problems with the chrome
integration of the tests.

Signed-off-by: Arnout Engelen <[email protected]>
  • Loading branch information
raboof committed Jun 17, 2024
1 parent 4abf016 commit 8987174
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/lib/github_basic_detective.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class GithubBasicDetective < Detective
OUTPUTS = %i[
name license discussion_status repo_public_status repo_track_status
repo_distributed_status contribution_status implementation_languages
version_tags
].freeze

# These are the 'correct' display case for SPDX for OSI-approved licenses.
Expand Down Expand Up @@ -170,6 +171,17 @@ def analyze(_evidence, current)
confidence: 3,
explanation: 'GitHub API implementation language analysis'
}

# Check for tags
tag_data = client.tags fullname
tags = tag_data.map { |tag| tag[:name] }
if tags.any? { |tag| tag.match?(/^v?\d+\.\d+\.\d+$/) }
results[:version_tags] = {
value: version_tags,
confidence: 2,
explanation: 'GitHub tags'
}
end
end

results
Expand Down

0 comments on commit 8987174

Please sign in to comment.