Skip to content

Commit

Permalink
Fix website matching for GitHub and GitLab repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jan 23, 2024
1 parent af196ed commit f21e4a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/collective.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ def project_url
social_link =(social_links || {}).select{|x| ['GITHUB', 'GITLAB', 'GIT'].include? x['type']}.first.try(:[], 'url')

# check if website is a github repo
return website if website.match(/github.com\/(.*)/)
return website if website.match(/github.com\/(.*)/i)

# check if website is a github pages site
return github_pages_to_repo_url(website) if website.match(/github.io/)
return github_pages_to_repo_url(website) if website.match(/github.io/i)

# check if website is a gitlab repo
return website if website.match(/gitlab.com\/(.*)/)
return website if website.match(/gitlab.com\/(.*)/i)

# validate social link (path should start with a letter)
# TODO sr.ht slugs start with ~
Expand Down

0 comments on commit f21e4a0

Please sign in to comment.