Skip to content

Commit

Permalink
6b7589b78374464b9fca58e52adee36e
Browse files Browse the repository at this point in the history
  • Loading branch information
medievil-inc committed Mar 23, 2023
1 parent 083f379 commit 5cc3b20
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/utils/notion_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ def create_comment_by_commit(notion, payload, commit)
},
rich_text: [
create_comment_title(content: '💬 Commit: '),
create_comment_description(content: "#{commit.message.gsub(/(\r\n|\n|\r)/, ' ')}\n"),
create_comment_description(content: "#{commit['message'].gsub(/(\r\n|\n|\r)/, ' ')}\n"),
create_comment_title(content: '👀 Branch: '),
create_comment_description(
content: "#{payload.ref}\n",
content: "#{payload['ref']}\n",
color: 'purple'
),
create_comment_title(content: '🐣 Author: '),
create_comment_description(
content: "#{commit.author.name}\n",
content: "#{commit['author']['name']}\n",
color: 'yellow',
code: true
),
create_comment_title(content: '📫 URL: '),
create_comment_description(
content: commit.url.to_s,
content: commit['url'],
color: 'blue',
url: commit.url
url: commit['url']
)
]
}
Expand Down Expand Up @@ -77,7 +77,7 @@ def create_comment_description(content, color, code: false, url: nil)

def search_page(notion, commit)
regex = '(?=(?:.*?[A-Za-z]))(?=(?:.*?[0-9]))[A-Za-z0-9]{32}'
query = commit.message.match(regex)&.[](0)
query = commit['message'].match(regex)&.[](0)

response = notion.search(
query:,
Expand Down

0 comments on commit 5cc3b20

Please sign in to comment.