Skip to content

Commit

Permalink
Clone wp post
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 18, 2024
1 parent 7578984 commit 461b45c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions wordpress-cloning-css-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def clone_css_files(environment, wordpress_staging_username, wordpress_staging_p
data = re.sub(r'@charset "UTF-8";\s*', '', data)
data = re.sub(r'\*/\s*/\* ROB 10/07/22', '/* ROB 10/07/22', data)
file.write(data + "\n\n")
message = f"Successfully added CSS from {url} to combined_styles.css"
message = f"Successfully added CSS from {url}"
writer.write_summary(f"- {message}\n")
else:
message = f"Skipping {url}: HTTP {response.status_code}"
Expand All @@ -55,7 +55,7 @@ def clone_css_files(environment, wordpress_staging_username, wordpress_staging_p
if style and style.string:
file.write("/* Inline CSS from HTML */\n")
file.write(style.string.strip() + "\n\n")
message = f"Successfully added inline CSS from HTML {url} to combined_styles.css"
message = f"Successfully added inline CSS from HTML {url}"
writer.write_summary(f"- {message}\n")
else:
message = f"Skipping {url}: HTTP {response.status_code}"
Expand Down
4 changes: 2 additions & 2 deletions wordpress-cloning-html-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ def main(environment, post_id, wordpress_staging_username, wordpress_staging_pas

except requests.exceptions.RequestException as e:
if environment == "PROD":
message = f"- Failed to fetch post {post_id} from {base_url}. \n Error: {e}"
message = f"Failed to fetch post {post_id} from {base_url}. \n Error: {e}"
writer.write_summary(f"- {message}\n")
writer.write_output("script-success", "false")
sys.exit(1)
else:
writer.write_output("script-success", "false")
message = f"- Skipping post {post_id} from {base_url}. \n Error: {e}"
message = f"Skipping post {post_id} from {base_url}. \n Error: {e}"
writer.write_summary(f"- {message}\n")


Expand Down

0 comments on commit 461b45c

Please sign in to comment.