Skip to content

Commit

Permalink
Updates to PR description
Browse files Browse the repository at this point in the history
  • Loading branch information
sshrihar committed Sep 24, 2024
1 parent e0c9989 commit 84ceb55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 95 deletions.
92 changes: 0 additions & 92 deletions .github/workflows/dev_deployment.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Hosted PR Deployment
name: Hosted PR and Dev Deployment
on:
pull_request:
types: [opened, edited, reopened]
Expand Down
8 changes: 6 additions & 2 deletions build_branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import subprocess


HOSTED_SITE_DOMAIN = "docs-dev.polygon.technology"


def install_mkdocs_with_pipenv():
"""
Builds a particular branch site.
Expand Down Expand Up @@ -78,9 +81,9 @@ def update_pr_description(pr_number):
if it does not already exist in the definition
:param pr_number: PR number for the branch hosting website
"""
command = ["gh", "pr", "view", pr_number, "--json", "body", "--jq", "'.body'"]
command = ["gh", "pr", "view", pr_number, "--json", "body", "--jq", ".body"]
pr_description = subprocess.run(command, capture_output=True, text=True).stdout.strip()
hosted_url = f"docs-dev.polygon.technology/{pr_number}"
hosted_url = f"{HOSTED_SITE_DOMAIN}/{pr_number}"
if hosted_url not in pr_description:
new_pr_description = f"Hosted url: [{hosted_url}](https://{hosted_url})\n" + pr_description
command = ["gh", "pr", "edit", pr_number, "--body", new_pr_description]
Expand Down Expand Up @@ -132,6 +135,7 @@ def update_nginx_config(pr_numbers):
}}
"""
nginx_location_blocks += location_block
print(f"Hosted site: https://{HOSTED_SITE_DOMAIN}/{pr_number}")

with open(config_file, "r+") as f:
content = f.read()
Expand Down

0 comments on commit 84ceb55

Please sign in to comment.