From ec5554c35734178a9c7db3ed8749549e58ffb5f3 Mon Sep 17 00:00:00 2001 From: Andrew Kang Date: Tue, 29 Oct 2024 09:59:17 -0700 Subject: [PATCH 1/3] fix conversion back to backticks and pr_number --- .github/workflows/github_actions/update_docs.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github_actions/update_docs.rb b/.github/workflows/github_actions/update_docs.rb index 954c5ae..6143460 100644 --- a/.github/workflows/github_actions/update_docs.rb +++ b/.github/workflows/github_actions/update_docs.rb @@ -86,7 +86,7 @@ def with_retry(max_attempts = 5) suggestions: suggestions, doc_context: doc_context, context_ignore_list: context_ignore_list - ).generate + ).generate.gsub!(/%%%(\w+)?\n/, '```\1\n').gsub!(/\n%%%/, "\n```") end end @@ -122,7 +122,7 @@ def with_retry(max_attempts = 5) repo: doc_repo_full_name, base: 'main', head: branch_name, - title: "Doc Updates from Sublayer PR ##{@pr_number}", - body: "This PR contains documentation updates based on changes in https://github.com/sublayerapp/sublayer/pull/#{@pr_number}." + title: "Doc Updates from Sublayer PR ##{pr_number}", + body: "This PR contains documentation updates based on changes in https://github.com/sublayerapp/sublayer/pull/#{pr_number}." ).call end \ No newline at end of file From aa8921bd0b9707e6ee712d0a57c6c6312d4b4294 Mon Sep 17 00:00:00 2001 From: Andrew Kang Date: Tue, 29 Oct 2024 13:30:16 -0700 Subject: [PATCH 2/3] convert file contents to triple backticks --- .github/workflows/github_actions/update_docs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github_actions/update_docs.rb b/.github/workflows/github_actions/update_docs.rb index 6143460..b0d8e90 100644 --- a/.github/workflows/github_actions/update_docs.rb +++ b/.github/workflows/github_actions/update_docs.rb @@ -86,7 +86,7 @@ def with_retry(max_attempts = 5) suggestions: suggestions, doc_context: doc_context, context_ignore_list: context_ignore_list - ).generate.gsub!(/%%%(\w+)?\n/, '```\1\n').gsub!(/\n%%%/, "\n```") + ).generate end end @@ -104,7 +104,7 @@ def with_retry(max_attempts = 5) # Now write the file updates to disk file_updates.each do |file_update| file_path = file_update["file_path"] - file_content = file_update["file_content"] + file_content = file_update["file_content"].gsub!(/%%%(\w+)?\n/, '```\1\n').gsub!(/\n%%%/, "\n```") puts "Updating file: #{file_path}" puts "file content: #{file_content}" From 4363d963468ba49bb8657b6bd6e986badfae57b9 Mon Sep 17 00:00:00 2001 From: Andrew Kang Date: Wed, 30 Oct 2024 12:41:37 -0700 Subject: [PATCH 3/3] fix for nil --- .github/workflows/github_actions/update_docs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_actions/update_docs.rb b/.github/workflows/github_actions/update_docs.rb index b0d8e90..df70caa 100644 --- a/.github/workflows/github_actions/update_docs.rb +++ b/.github/workflows/github_actions/update_docs.rb @@ -104,7 +104,7 @@ def with_retry(max_attempts = 5) # Now write the file updates to disk file_updates.each do |file_update| file_path = file_update["file_path"] - file_content = file_update["file_content"].gsub!(/%%%(\w+)?\n/, '```\1\n').gsub!(/\n%%%/, "\n```") + file_content = file_update["file_content"].gsub(/%%%(\w+)?\n/, '```\1\n').gsub(/\n%%%/, "\n```") puts "Updating file: #{file_path}" puts "file content: #{file_content}"