Skip to content

Commit

Permalink
chore: refactor contributions.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
imskr committed Mar 10, 2024
1 parent 5a074fd commit 59abeb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contributions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def run

private

def fetch_and_update_readme(project, url, readme_path, commit_message, git_username, git_email)
uri = URI(url)
def fetch_and_update_readme(project, gitlab_url, readme_path, commit_message, git_username, git_email)
uri = URI(gitlab_url)
req = Net::HTTP::Get.new(uri)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
Expand All @@ -44,8 +44,8 @@ def fetch_and_update_readme(project, url, readme_path, commit_message, git_usern

def update_readme_content(project, readme_path, merged_count)
readme_content = File.read(readme_path)
start_marker = ''
end_marker = ''
start_marker = '<!-- MERGED_PULL_REQUESTS_START -->'
end_marker = '<!-- MERGED_PULL_REQUESTS_END -->'
updated_readme_content = readme_content.gsub(/#{start_marker}.*#{end_marker}/m, "#{start_marker}\nPull requests merged in #{project}: #{merged_count}\n#{end_marker}")
File.write(readme_path, updated_readme_content)
end
Expand Down

0 comments on commit 59abeb4

Please sign in to comment.